Skip to content

Commit 1bbc609

Browse files
Fjabiyev/opt out c# sdk (Azure#47060)
* Run Autorest,Export-Api, implement new clients * Add unit tests * Add new live tests * Update spec acpi url * Update api * Push assets * Push tests * Different models for opt add and remove endpoints, few more live tests * Set changelog date
1 parent ea16541 commit 1bbc609

34 files changed

+2138
-96
lines changed

sdk/communication/Azure.Communication.Sms/CHANGELOG.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# Release History
22

3-
## 1.1.0-beta.2 (Unreleased)
3+
## 1.1.0-beta.2 (2024-12-10)
44

55
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
6+
- Added support for Opt Out Management Api to:
7+
- Opt-out the recipient.
8+
- Opt-in the recipient.
9+
- Check if the recpient is opted-out or not.
1210

1311
## 1.1.0-beta.1 (2024-05-07)
1412

sdk/communication/Azure.Communication.Sms/api/Azure.Communication.Sms.net8.0.cs

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
namespace Azure.Communication.Sms
22
{
3+
public partial class OptOutsClient
4+
{
5+
protected OptOutsClient() { }
6+
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutAddResponseItem>> Add(string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
7+
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutAddResponseItem>>> AddAsync(string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
8+
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutResponseItem>> Check(string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
9+
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutResponseItem>>> CheckAsync(string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
10+
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutRemoveResponseItem>> Remove(string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
11+
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutRemoveResponseItem>>> RemoveAsync(string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
12+
}
313
public partial class SmsClient
414
{
515
protected SmsClient() { }
616
public SmsClient(string connectionString) { }
717
public SmsClient(string connectionString, Azure.Communication.Sms.SmsClientOptions options) { }
818
public SmsClient(System.Uri endpoint, Azure.AzureKeyCredential keyCredential, Azure.Communication.Sms.SmsClientOptions options = null) { }
919
public SmsClient(System.Uri endpoint, Azure.Core.TokenCredential tokenCredential, Azure.Communication.Sms.SmsClientOptions options = null) { }
20+
public virtual Azure.Communication.Sms.OptOutsClient OptOuts { get { throw null; } }
1021
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.SmsSendResult>> Send(string from, System.Collections.Generic.IEnumerable<string> to, string message, Azure.Communication.Sms.SmsSendOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
1122
public virtual Azure.Response<Azure.Communication.Sms.SmsSendResult> Send(string from, string to, string message, Azure.Communication.Sms.SmsSendOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
1223
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.SmsSendResult>>> SendAsync(string from, System.Collections.Generic.IEnumerable<string> to, string message, Azure.Communication.Sms.SmsSendOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
1324
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.Sms.SmsSendResult>> SendAsync(string from, string to, string message, Azure.Communication.Sms.SmsSendOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
1425
}
1526
public partial class SmsClientOptions : Azure.Core.ClientOptions
1627
{
17-
public SmsClientOptions(Azure.Communication.Sms.SmsClientOptions.ServiceVersion version = Azure.Communication.Sms.SmsClientOptions.ServiceVersion.V2024_02_05_Preview) { }
28+
public SmsClientOptions(Azure.Communication.Sms.SmsClientOptions.ServiceVersion version = Azure.Communication.Sms.SmsClientOptions.ServiceVersion.V2024_12_10_Preview) { }
1829
public enum ServiceVersion
1930
{
2031
V2021_03_07 = 1,
21-
V2024_02_05_Preview = 2,
32+
V2024_12_10_Preview = 2,
2233
}
2334
}
2435
public partial class SmsSendOptions
@@ -40,6 +51,57 @@ internal SmsSendResult() { }
4051
}
4152
namespace Azure.Communication.Sms.Models
4253
{
54+
public static partial class CommunicationSmsModelFactory
55+
{
56+
public static Azure.Communication.Sms.Models.OptOutResponse OptOutResponse(System.Collections.Generic.IEnumerable<Azure.Communication.Sms.Models.OptOutResponseItem> value = null) { throw null; }
57+
public static Azure.Communication.Sms.Models.OptOutResponseItem OptOutResponseItem(string to = null, int httpStatusCode = 0, bool? isOptedOut = default(bool?), string errorMessage = null) { throw null; }
58+
}
59+
public partial class OptOutAddResponse
60+
{
61+
internal OptOutAddResponse() { }
62+
public System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutAddResponseItem> Value { get { throw null; } }
63+
}
64+
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
65+
public partial struct OptOutAddResponseItem
66+
{
67+
private object _dummy;
68+
private int _dummyPrimitive;
69+
public string ErrorMessage { get { throw null; } }
70+
public int HttpStatusCode { get { throw null; } }
71+
public string To { get { throw null; } }
72+
}
73+
public partial class OptOutRecipient
74+
{
75+
public OptOutRecipient(string to) { }
76+
public string To { get { throw null; } }
77+
}
78+
public partial class OptOutRemoveResponse
79+
{
80+
internal OptOutRemoveResponse() { }
81+
public System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutRemoveResponseItem> Value { get { throw null; } }
82+
}
83+
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
84+
public partial struct OptOutRemoveResponseItem
85+
{
86+
private object _dummy;
87+
private int _dummyPrimitive;
88+
public string ErrorMessage { get { throw null; } }
89+
public int HttpStatusCode { get { throw null; } }
90+
public string To { get { throw null; } }
91+
}
92+
public partial class OptOutResponse
93+
{
94+
internal OptOutResponse() { }
95+
public System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutResponseItem> Value { get { throw null; } }
96+
}
97+
public partial class OptOutResponseItem
98+
{
99+
internal OptOutResponseItem() { }
100+
public string ErrorMessage { get { throw null; } }
101+
public int HttpStatusCode { get { throw null; } }
102+
public bool? IsOptedOut { get { throw null; } }
103+
public string To { get { throw null; } }
104+
}
43105
public static partial class SmsModelFactory
44106
{
45107
public static Azure.Communication.Sms.SmsSendResult SmsSendResult(string to, string messageId, int httpStatusCode, bool successful, string errorMessage) { throw null; }

sdk/communication/Azure.Communication.Sms/api/Azure.Communication.Sms.netstandard2.0.cs

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
namespace Azure.Communication.Sms
22
{
3+
public partial class OptOutsClient
4+
{
5+
protected OptOutsClient() { }
6+
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutAddResponseItem>> Add(string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
7+
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutAddResponseItem>>> AddAsync(string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
8+
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutResponseItem>> Check(string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
9+
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutResponseItem>>> CheckAsync(string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
10+
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutRemoveResponseItem>> Remove(string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
11+
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutRemoveResponseItem>>> RemoveAsync(string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
12+
}
313
public partial class SmsClient
414
{
515
protected SmsClient() { }
616
public SmsClient(string connectionString) { }
717
public SmsClient(string connectionString, Azure.Communication.Sms.SmsClientOptions options) { }
818
public SmsClient(System.Uri endpoint, Azure.AzureKeyCredential keyCredential, Azure.Communication.Sms.SmsClientOptions options = null) { }
919
public SmsClient(System.Uri endpoint, Azure.Core.TokenCredential tokenCredential, Azure.Communication.Sms.SmsClientOptions options = null) { }
20+
public virtual Azure.Communication.Sms.OptOutsClient OptOuts { get { throw null; } }
1021
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.SmsSendResult>> Send(string from, System.Collections.Generic.IEnumerable<string> to, string message, Azure.Communication.Sms.SmsSendOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
1122
public virtual Azure.Response<Azure.Communication.Sms.SmsSendResult> Send(string from, string to, string message, Azure.Communication.Sms.SmsSendOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
1223
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.SmsSendResult>>> SendAsync(string from, System.Collections.Generic.IEnumerable<string> to, string message, Azure.Communication.Sms.SmsSendOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
1324
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.Sms.SmsSendResult>> SendAsync(string from, string to, string message, Azure.Communication.Sms.SmsSendOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
1425
}
1526
public partial class SmsClientOptions : Azure.Core.ClientOptions
1627
{
17-
public SmsClientOptions(Azure.Communication.Sms.SmsClientOptions.ServiceVersion version = Azure.Communication.Sms.SmsClientOptions.ServiceVersion.V2024_02_05_Preview) { }
28+
public SmsClientOptions(Azure.Communication.Sms.SmsClientOptions.ServiceVersion version = Azure.Communication.Sms.SmsClientOptions.ServiceVersion.V2024_12_10_Preview) { }
1829
public enum ServiceVersion
1930
{
2031
V2021_03_07 = 1,
21-
V2024_02_05_Preview = 2,
32+
V2024_12_10_Preview = 2,
2233
}
2334
}
2435
public partial class SmsSendOptions
@@ -40,6 +51,57 @@ internal SmsSendResult() { }
4051
}
4152
namespace Azure.Communication.Sms.Models
4253
{
54+
public static partial class CommunicationSmsModelFactory
55+
{
56+
public static Azure.Communication.Sms.Models.OptOutResponse OptOutResponse(System.Collections.Generic.IEnumerable<Azure.Communication.Sms.Models.OptOutResponseItem> value = null) { throw null; }
57+
public static Azure.Communication.Sms.Models.OptOutResponseItem OptOutResponseItem(string to = null, int httpStatusCode = 0, bool? isOptedOut = default(bool?), string errorMessage = null) { throw null; }
58+
}
59+
public partial class OptOutAddResponse
60+
{
61+
internal OptOutAddResponse() { }
62+
public System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutAddResponseItem> Value { get { throw null; } }
63+
}
64+
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
65+
public partial struct OptOutAddResponseItem
66+
{
67+
private object _dummy;
68+
private int _dummyPrimitive;
69+
public string ErrorMessage { get { throw null; } }
70+
public int HttpStatusCode { get { throw null; } }
71+
public string To { get { throw null; } }
72+
}
73+
public partial class OptOutRecipient
74+
{
75+
public OptOutRecipient(string to) { }
76+
public string To { get { throw null; } }
77+
}
78+
public partial class OptOutRemoveResponse
79+
{
80+
internal OptOutRemoveResponse() { }
81+
public System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutRemoveResponseItem> Value { get { throw null; } }
82+
}
83+
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
84+
public partial struct OptOutRemoveResponseItem
85+
{
86+
private object _dummy;
87+
private int _dummyPrimitive;
88+
public string ErrorMessage { get { throw null; } }
89+
public int HttpStatusCode { get { throw null; } }
90+
public string To { get { throw null; } }
91+
}
92+
public partial class OptOutResponse
93+
{
94+
internal OptOutResponse() { }
95+
public System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutResponseItem> Value { get { throw null; } }
96+
}
97+
public partial class OptOutResponseItem
98+
{
99+
internal OptOutResponseItem() { }
100+
public string ErrorMessage { get { throw null; } }
101+
public int HttpStatusCode { get { throw null; } }
102+
public bool? IsOptedOut { get { throw null; } }
103+
public string To { get { throw null; } }
104+
}
43105
public static partial class SmsModelFactory
44106
{
45107
public static Azure.Communication.Sms.SmsSendResult SmsSendResult(string to, string messageId, int httpStatusCode, bool successful, string errorMessage) { throw null; }

sdk/communication/Azure.Communication.Sms/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "net",
44
"TagPrefix": "net/communication/Azure.Communication.Sms",
5-
"Tag": "net/communication/Azure.Communication.Sms_3b274f81e7"
5+
"Tag": "net/communication/Azure.Communication.Sms_b96598d9ba"
66
}

sdk/communication/Azure.Communication.Sms/src/Generated/CommunicationSmsModelFactory.cs

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/communication/Azure.Communication.Sms/src/Generated/Models/OptOutRecipient.Serialization.cs

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/communication/Azure.Communication.Sms/src/Generated/Models/OptOutRecipient.cs

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)