Skip to content

Commit 0e80fd6

Browse files
Improved Overall code and structure
1 parent 38eb311 commit 0e80fd6

File tree

108 files changed

+1085
-2009
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1085
-2009
lines changed
Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
1-
using InfobipClientExamples.examples;
2-
3-
namespace InfobipClientExamples
1+
namespace Infobip.Api.Client.Examples
42
{
53
class ExampleRunner
64
{
75
static void Main(string[] args)
86
{
97
// Uncomment an example to run it
108

11-
//new AdvancedSmsDeliveryTimeWindowExample().RunExample();
12-
//new AdvancedSmsExample().RunExample();
13-
//new AdvancedSmsFlashExample().RunExample();
14-
//new AdvancedSmsLanguageExample().RunExample();
15-
//new AdvancedSmsNotifyExample().RunExample();
16-
//new AdvancedSmsSchedulingExample().RunExample();
17-
//new AdvancedSmsTrackingExample().RunExample();
9+
//new AdvancedSmsDeliveryTimeWindowExample().RunExampleAsync().Wait();
10+
//new AdvancedSmsExample().RunExampleAsync().Wait();
11+
//new AdvancedSmsFlashExample().RunExampleAsync().Wait();
12+
//new AdvancedSmsLanguageExample().RunExampleAsync().Wait();
13+
//new AdvancedSmsNotifyExample().RunExampleAsync().Wait();
14+
new AdvancedSmsSchedulingExample().RunExampleAsync().Wait();
15+
//new AdvancedSmsTrackingExample().RunExampleAsync().Wait();
1816

19-
//new GetAccountBalanceExample().RunExample();
17+
//new GetAccountBalanceExample().RunExampleAsync().Wait();
2018

21-
//new GetInboxLogsExample().RunExample();
22-
//new GetSentLogsDeliveredExample().RunExample();
23-
//new GetSentLogsExample().RunExample();
19+
//new GetInboxLogsExample().RunExampleAsync().Wait();
20+
//new GetSentLogsDeliveredExample().RunExampleAsync().Wait();
21+
//new GetSentLogsExample().RunExampleAsync().Wait();
2422

25-
//new LogEndTagExample().RunExample();
23+
//new LogEndTagExample().RunExampleAsync().Wait();
2624

27-
//new NumberContextNotifyExample().RunExample();
28-
//new NumberContextQueryExample().RunExample();
25+
//new NumberContextNotifyExample().RunExampleAsync().Wait();
26+
//new NumberContextQueryExample().RunExampleAsync().Wait();
2927

30-
//new PullInboxDeliveryReportsExample().RunExample();
31-
//new PullSentDeliveryReportsExample().RunExample();
28+
//new PullInboxDeliveryReportsExample().RunExampleAsync().Wait();
29+
//new PullSentDeliveryReportsExample().RunExampleAsync().Wait();
3230

33-
//new SingleTextualSmsExample().RunExample();
31+
//new SingleTextualSmsExample().RunExampleAsync().Wait();
3432

35-
//new SmsPreviewExample().RunExample();
33+
//new SmsPreviewExample().RunExampleAsync().Wait();
3634
}
3735
}
3836
}

InfobipClient/InfobipClientExamples/InfobipClientExamples.csproj

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,25 @@
4242
</ItemGroup>
4343
<ItemGroup>
4444
<Compile Include="ExampleRunner.cs" />
45-
<Compile Include="examples\AdvancedSmsDeliveryTimeWindowExample.cs" />
46-
<Compile Include="examples\AdvancedSmsExample.cs" />
47-
<Compile Include="examples\AdvancedSmsFlashExample.cs" />
48-
<Compile Include="examples\AdvancedSmsLanguageExample.cs" />
49-
<Compile Include="examples\AdvancedSmsNotifyExample.cs" />
50-
<Compile Include="examples\AdvancedSmsSchedulingExample.cs" />
51-
<Compile Include="examples\AdvancedSmsTrackingExample.cs" />
52-
<Compile Include="examples\Example.cs" />
53-
<Compile Include="examples\GetAccountBalanceExample.cs" />
54-
<Compile Include="examples\GetInboxLogsExample.cs" />
55-
<Compile Include="examples\GetSentLogsDeliveredExample.cs" />
56-
<Compile Include="examples\GetSentLogsExample.cs" />
57-
<Compile Include="examples\LogEndTagExample.cs" />
58-
<Compile Include="examples\NumberContextNotifyExample.cs" />
59-
<Compile Include="examples\NumberContextQueryExample.cs" />
60-
<Compile Include="examples\PullInboxDeliveryReportsExample.cs" />
61-
<Compile Include="examples\PullSentDeliveryReportsExample.cs" />
62-
<Compile Include="examples\SingleTextualSmsExample.cs" />
63-
<Compile Include="examples\SmsPreviewExample.cs" />
45+
<Compile Include="Examples\AdvancedSmsDeliveryTimeWindowExample.cs" />
46+
<Compile Include="Examples\AdvancedSmsExample.cs" />
47+
<Compile Include="Examples\AdvancedSmsFlashExample.cs" />
48+
<Compile Include="Examples\AdvancedSmsLanguageExample.cs" />
49+
<Compile Include="Examples\AdvancedSmsNotifyExample.cs" />
50+
<Compile Include="Examples\AdvancedSmsSchedulingExample.cs" />
51+
<Compile Include="Examples\AdvancedSmsTrackingExample.cs" />
52+
<Compile Include="Examples\Example.cs" />
53+
<Compile Include="Examples\GetAccountBalanceExample.cs" />
54+
<Compile Include="Examples\GetInboxLogsExample.cs" />
55+
<Compile Include="Examples\GetSentLogsDeliveredExample.cs" />
56+
<Compile Include="Examples\GetSentLogsExample.cs" />
57+
<Compile Include="Examples\LogEndTagExample.cs" />
58+
<Compile Include="Examples\NumberContextNotifyExample.cs" />
59+
<Compile Include="Examples\NumberContextQueryExample.cs" />
60+
<Compile Include="Examples\PullInboxDeliveryReportsExample.cs" />
61+
<Compile Include="Examples\PullSentDeliveryReportsExample.cs" />
62+
<Compile Include="Examples\SingleTextualSmsExample.cs" />
63+
<Compile Include="Examples\SmsPreviewExample.cs" />
6464
</ItemGroup>
6565
<ItemGroup>
6666
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">

InfobipClient/InfobipClientExamples/examples/AdvancedSmsDeliveryTimeWindowExample.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
using InfobipClient.infobip.api.client;
2-
using InfobipClient.infobip.api.model;
3-
using InfobipClient.infobip.api.model.sms.mt.send;
4-
using InfobipClient.infobip.api.model.sms.mt.send.textual;
1+
using Infobip.Api.Model;
2+
using Infobip.Api.Model.Sms.Mt.Send;
3+
using Infobip.Api.Model.Sms.Mt.Send.Textual;
54
using System;
65
using System.Collections.Generic;
6+
using System.Threading.Tasks;
77

8-
namespace InfobipClientExamples.examples
8+
namespace Infobip.Api.Client.Examples
99
{
1010
class AdvancedSmsDeliveryTimeWindowExample : Example
1111
{
12-
public override void RunExample()
12+
public override async Task RunExampleAsync()
1313
{
14-
string messageId = AdvancedSms();
14+
string messageId = await AdvancedSmsAsync();
1515

1616
System.Threading.Thread.Sleep(3000);
1717

18-
GetSmsReport(messageId);
18+
await GetSmsReportAsync(messageId);
1919
}
2020

21-
private static string AdvancedSms()
21+
private static async Task<string> AdvancedSmsAsync()
2222
{
2323
Console.WriteLine("-------------------------------");
2424
Console.WriteLine("Sending fully featured textual message with delivery time window...");
@@ -35,15 +35,15 @@ private static string AdvancedSms()
3535
From = FROM,
3636
Destinations = new List<Destination>(1) { destination },
3737
Text = "Advanced message example",
38-
DeliveryTimeWindow = generateDeliveryTimeWindow()
38+
DeliveryTimeWindow = GenerateDeliveryTimeWindow()
3939
};
4040

4141
SMSAdvancedTextualRequest request = new SMSAdvancedTextualRequest
4242
{
4343
Messages = new List<Message>(1) { message }
4444
};
4545

46-
SMSResponse smsResponse = smsClient.Execute(request);
46+
SMSResponse smsResponse = await smsClient.ExecuteAsync(request);
4747

4848
Console.WriteLine("Sending fully featured textual message with delivery time window complete.");
4949

@@ -57,7 +57,7 @@ private static string AdvancedSms()
5757
return sentMessageInfo.MessageId;
5858
}
5959

60-
private static DeliveryTimeWindow generateDeliveryTimeWindow()
60+
private static DeliveryTimeWindow GenerateDeliveryTimeWindow()
6161
{
6262
DeliveryTime deliveryTimeFrom = new DeliveryTime
6363
{

InfobipClient/InfobipClientExamples/examples/AdvancedSmsExample.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
using InfobipClient.infobip.api.client;
2-
using InfobipClient.infobip.api.model;
3-
using InfobipClient.infobip.api.model.sms.mt.send;
4-
using InfobipClient.infobip.api.model.sms.mt.send.textual;
1+
using Infobip.Api.Model;
2+
using Infobip.Api.Model.Sms.Mt.Send;
3+
using Infobip.Api.Model.Sms.Mt.Send.Textual;
54
using System;
65
using System.Collections.Generic;
6+
using System.Threading.Tasks;
77

8-
namespace InfobipClientExamples.examples
8+
namespace Infobip.Api.Client.Examples
99
{
1010
class AdvancedSmsExample : Example
1111
{
12-
public override void RunExample()
12+
public override async Task RunExampleAsync()
1313
{
14-
string messageId = AdvancedSms();
14+
string messageId = await AdvancedSmsAsync();
1515

1616
System.Threading.Thread.Sleep(2000);
1717

18-
GetSmsReport(messageId);
18+
await GetSmsReportAsync(messageId);
1919
}
2020

21-
private static string AdvancedSms()
21+
private static async Task<string> AdvancedSmsAsync()
2222
{
2323
Console.WriteLine("-------------------------------");
2424
Console.WriteLine("Sending fully featured textual message...");
@@ -42,7 +42,7 @@ private static string AdvancedSms()
4242
Messages = new List<Message>(1) { message }
4343
};
4444

45-
SMSResponse smsResponse = smsClient.Execute(request);
45+
SMSResponse smsResponse = await smsClient.ExecuteAsync(request);
4646

4747
Console.WriteLine("Sending fully featured textual message complete.");
4848

InfobipClient/InfobipClientExamples/examples/AdvancedSmsFlashExample.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
using InfobipClient.infobip.api.client;
2-
using InfobipClient.infobip.api.model;
3-
using InfobipClient.infobip.api.model.sms.mt.send;
4-
using InfobipClient.infobip.api.model.sms.mt.send.textual;
1+
using Infobip.Api.Model;
2+
using Infobip.Api.Model.Sms.Mt.Send;
3+
using Infobip.Api.Model.Sms.Mt.Send.Textual;
54
using System;
65
using System.Collections.Generic;
6+
using System.Threading.Tasks;
77

8-
namespace InfobipClientExamples.examples
8+
namespace Infobip.Api.Client.Examples
99
{
1010
class AdvancedSmsFlashExample : Example
1111
{
12-
public override void RunExample()
12+
public override async Task RunExampleAsync()
1313
{
14-
string messageId = AdvancedSms();
14+
string messageId = await AdvancedSmsAsync();
1515

1616
System.Threading.Thread.Sleep(2000);
1717

18-
GetSmsReport(messageId);
18+
await GetSmsReportAsync(messageId);
1919
}
2020

21-
private static string AdvancedSms()
21+
private static async Task<string> AdvancedSmsAsync()
2222
{
2323
Console.WriteLine("-------------------------------");
2424
Console.WriteLine("Sending fully featured flash message...");
@@ -43,7 +43,7 @@ private static string AdvancedSms()
4343
Messages = new List<Message>(1) { message }
4444
};
4545

46-
SMSResponse smsResponse = smsClient.Execute(request);
46+
SMSResponse smsResponse = await smsClient.ExecuteAsync(request);
4747

4848
Console.WriteLine("Sending fully featured flash message complete.");
4949

InfobipClient/InfobipClientExamples/examples/AdvancedSmsLanguageExample.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
using InfobipClient.infobip.api.client;
2-
using InfobipClient.infobip.api.model;
3-
using InfobipClient.infobip.api.model.sms.mt.send;
4-
using InfobipClient.infobip.api.model.sms.mt.send.textual;
1+
using Infobip.Api.Model;
2+
using Infobip.Api.Model.Sms.Mt.Send;
3+
using Infobip.Api.Model.Sms.Mt.Send.Textual;
54
using System;
65
using System.Collections.Generic;
6+
using System.Threading.Tasks;
77

8-
namespace InfobipClientExamples.examples
8+
namespace Infobip.Api.Client.Examples
99
{
1010
class AdvancedSmsLanguageExample : Example
1111
{
12-
public override void RunExample()
12+
public override async Task RunExampleAsync()
1313
{
14-
string messageId = AdvancedSms();
14+
string messageId = await AdvancedSmsAsync();
1515

1616
System.Threading.Thread.Sleep(2000);
1717

18-
GetSmsReport(messageId);
18+
await GetSmsReportAsync(messageId);
1919
}
2020

21-
private static string AdvancedSms()
21+
private static async Task<string> AdvancedSmsAsync()
2222
{
2323
Console.WriteLine("-------------------------------");
2424
Console.WriteLine("Sending fully featured textual message with language...");
@@ -51,7 +51,7 @@ private static string AdvancedSms()
5151
Messages = new List<Message>(1) { message }
5252
};
5353

54-
SMSResponse smsResponse = smsClient.Execute(request);
54+
SMSResponse smsResponse = await smsClient.ExecuteAsync(request);
5555

5656
Console.WriteLine("Sending fully featured textual message with language complete.");
5757

InfobipClient/InfobipClientExamples/examples/AdvancedSmsNotifyExample.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
using InfobipClient.infobip.api.client;
2-
using InfobipClient.infobip.api.model;
3-
using InfobipClient.infobip.api.model.sms.mt.send;
4-
using InfobipClient.infobip.api.model.sms.mt.send.textual;
1+
using Infobip.Api.Model;
2+
using Infobip.Api.Model.Sms.Mt.Send;
3+
using Infobip.Api.Model.Sms.Mt.Send.Textual;
54
using System;
65
using System.Collections.Generic;
6+
using System.Threading.Tasks;
77

8-
namespace InfobipClientExamples.examples
8+
namespace Infobip.Api.Client.Examples
99
{
1010
class AdvancedSmsNotifyExample : Example
1111
{
12-
public override void RunExample()
12+
public override async Task RunExampleAsync()
1313
{
14-
string messageId = AdvancedSms();
14+
string messageId = await AdvancedSmsAsync();
1515

1616
System.Threading.Thread.Sleep(2000);
1717

18-
GetSmsReport(messageId);
18+
await GetSmsReportAsync(messageId);
1919
}
2020

21-
private static string AdvancedSms()
21+
private static async Task<string> AdvancedSmsAsync()
2222
{
2323
Console.WriteLine("-------------------------------");
2424
Console.WriteLine("Sending fully featured textual message with notify...");
@@ -43,7 +43,7 @@ private static string AdvancedSms()
4343
Messages = new List<Message>(1) { message }
4444
};
4545

46-
SMSResponse smsResponse = smsClient.Execute(request);
46+
SMSResponse smsResponse = await smsClient.ExecuteAsync(request);
4747

4848
Console.WriteLine("Sending fully featured textual message with notify complete.");
4949

0 commit comments

Comments
 (0)