Skip to content

Commit 285cd34

Browse files
Merge pull request #8 from infobip/PAPI-2580-india-dlt
Added necessary parameters for india DLT and added the example for it
2 parents dbab7ea + 704ee0f commit 285cd34

File tree

9 files changed

+117
-0
lines changed

9 files changed

+117
-0
lines changed

InfobipClient/InfobipClientExamples/ExampleRunner.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ static void Main(string[] args)
1313
//new AdvancedSmsNotifyExample().RunExampleAsync().Wait();
1414
//new AdvancedSmsSchedulingExample().RunExampleAsync().Wait();
1515
//new AdvancedSmsTrackingExample().RunExampleAsync().Wait();
16+
//new AdvancedSmsIndiaDltExample().RunExampleAsync().Wait();
1617

1718
//new GetAccountBalanceExample().RunExampleAsync().Wait();
1819

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
using Infobip.Api.Model;
2+
using Infobip.Api.Model.Sms.Mt.Send;
3+
using Infobip.Api.Model.Sms.Mt.Send.Textual;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Threading.Tasks;
7+
8+
namespace Infobip.Api.Client.Examples
9+
{
10+
class AdvancedSmsIndiaDltExample : Example
11+
{
12+
public override async Task RunExampleAsync()
13+
{
14+
string messageId = await AdvancedSmsAsync();
15+
16+
System.Threading.Thread.Sleep(2000);
17+
18+
await GetSmsReportAsync(messageId);
19+
}
20+
21+
private static async Task<string> AdvancedSmsAsync()
22+
{
23+
Console.WriteLine("-------------------------------");
24+
Console.WriteLine("Sending fully featured textual message with India DLT regional options...");
25+
26+
SendMultipleTextualSmsAdvanced smsClient = new SendMultipleTextualSmsAdvanced(BASIC_AUTH_CONFIGURATION);
27+
28+
Destination destination = new Destination
29+
{
30+
To = TO
31+
};
32+
33+
34+
IndiaDltOptions indiaDlt = new IndiaDltOptions();
35+
indiaDlt.ContentTemplateId = "some-content-template-id";
36+
indiaDlt.PrincipalEntityId = "some-principal-entity-id";
37+
38+
RegionalOptions regionalOptions = new RegionalOptions();
39+
regionalOptions.IndiaDlt = indiaDlt;
40+
41+
Message message = new Message
42+
{
43+
From = FROM,
44+
Destinations = new List<Destination>(1) { destination },
45+
Text = "Advanced message example with India DLT regional options",
46+
Regional = regionalOptions
47+
};
48+
49+
SMSAdvancedTextualRequest request = new SMSAdvancedTextualRequest
50+
{
51+
Messages = new List<Message>(1) { message }
52+
};
53+
54+
SMSResponse smsResponse = await smsClient.ExecuteAsync(request);
55+
56+
Console.WriteLine("Sending fully featured textual message with India DLT regional options complete.");
57+
58+
SMSResponseDetails sentMessageInfo = smsResponse.Messages[0];
59+
Console.WriteLine("-------------------------------");
60+
Console.WriteLine("Message ID: " + sentMessageInfo.MessageId);
61+
Console.WriteLine("Receiver: " + sentMessageInfo.To);
62+
Console.WriteLine("Message status: " + sentMessageInfo.Status.Name);
63+
Console.WriteLine("-------------------------------");
64+
65+
return sentMessageInfo.MessageId;
66+
}
67+
}
68+
}

InfobipClient/InfobipClientExamples/InfobipClientExamples.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<Compile Include="Examples\NumberContextQueryExample.cs" />
5555
<Compile Include="Examples\PullInboxDeliveryReportsExample.cs" />
5656
<Compile Include="Examples\PullSentDeliveryReportsExample.cs" />
57+
<Compile Include="Examples\AdvancedSmsIndiaDltExample.cs" />
5758
<Compile Include="Examples\SingleTextualSmsExample.cs" />
5859
<Compile Include="Examples\SmsPreviewExample.cs" />
5960
</ItemGroup>

InfobipClient/InfobipClientLib/Infobip/Api/Model/Sms/Mt/Send/Binary/SMSBinaryRequest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public class SMSBinaryRequest
2525
[JsonProperty("operatorClientId")]
2626
public string OperatorClientId { get; set; }
2727

28+
[JsonProperty("regional")]
29+
public RegionalOptions Regional { get; set; }
30+
2831

2932
}
3033
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Collections.Generic;
2+
using Newtonsoft.Json;
3+
using System;
4+
5+
namespace Infobip.Api.Model.Sms.Mt.Send
6+
{
7+
/// <summary>
8+
/// This is a generated class and is not intended for modification!
9+
/// </summary>
10+
public class IndiaDltOptions
11+
{
12+
[JsonProperty("contentTemplateId")]
13+
public string ContentTemplateId { get; set; }
14+
15+
[JsonProperty("principalEntityId")]
16+
public string PrincipalEntityId { get; set; }
17+
18+
19+
}
20+
}

InfobipClient/InfobipClientLib/Infobip/Api/Model/Sms/Mt/Send/Message.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public class Message
6767
[JsonProperty("operatorClientId")]
6868
public string OperatorClientId { get; set; }
6969

70+
[JsonProperty("regional")]
71+
public RegionalOptions Regional { get; set; }
7072

7173
}
7274
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System.Collections.Generic;
2+
using Infobip.Api.Model.Sms.Mt.Send;
3+
using Newtonsoft.Json;
4+
using System;
5+
6+
namespace Infobip.Api.Model.Sms.Mt.Send
7+
{
8+
/// <summary>
9+
/// This is a generated class and is not intended for modification!
10+
/// </summary>
11+
public class RegionalOptions
12+
{
13+
[JsonProperty("indiaDlt")]
14+
public IndiaDltOptions IndiaDlt { get; set; }
15+
16+
17+
}
18+
}

InfobipClient/InfobipClientLib/Infobip/Api/Model/Sms/Mt/Send/Textual/SMSTextualRequest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public class SMSTextualRequest
2727
[JsonProperty("transliteration")]
2828
public string Transliteration { get; set; }
2929

30+
[JsonProperty("regional")]
31+
public RegionalOptions Regional { get; set; }
3032

3133
}
3234
}

InfobipClient/InfobipClientLib/InfobipClientLib.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,14 @@
174174
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\DeliveryDay.cs" />
175175
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\DeliveryTime.cs" />
176176
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\DeliveryTimeWindow.cs" />
177+
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\IndiaDltOptions.cs" />
177178
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\Language.cs" />
178179
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\Message.cs" />
179180
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\Preview\Configuration.cs" />
180181
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\Preview\Preview.cs" />
181182
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\Preview\PreviewRequest.cs" />
182183
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\Preview\PreviewResponse.cs" />
184+
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\RegionalOptions.cs" />
183185
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\SMSResponse.cs" />
184186
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\SMSResponseDetails.cs" />
185187
<Compile Include="Infobip\Api\Model\Sms\Mt\Send\Textual\SMSAdvancedTextualRequest.cs" />

0 commit comments

Comments
 (0)