@@ -24,17 +24,25 @@ public class SmsClient
2424 /// <param name="endpoint">The URI of the Azure Communication Services resource.</param>
2525 /// <param name="keyCredential">The <see cref="AzureKeyCredential"/> used to authenticate requests.</param>
2626 /// <param name="options">Client option exposing <see cref="ClientOptions.Diagnostics"/>, <see cref="ClientOptions.Retry"/>, <see cref="ClientOptions.Transport"/>, etc.</param>
27- public SmsClient ( Uri endpoint , AzureKeyCredential keyCredential , SmsClientOptions ? options = default )
27+ public SmsClient ( Uri endpoint , AzureKeyCredential keyCredential , SmsClientOptions options = default )
2828 : this (
2929 AssertNotNull ( endpoint , nameof ( endpoint ) ) ,
3030 options ?? new SmsClientOptions ( ) ,
3131 AssertNotNull ( keyCredential , nameof ( keyCredential ) ) )
3232 { }
3333
34+ /// <summary> Initializes a new instance of <see cref="SmsClient"/>.</summary>
35+ /// <param name="connectionString">Connection string acquired from the Azure Communication Services resource.</param>
36+ public SmsClient ( string connectionString )
37+ : this (
38+ new SmsClientOptions ( ) ,
39+ ConnectionString . Parse ( AssertNotNullOrEmpty ( connectionString , nameof ( connectionString ) ) ) )
40+ { }
41+
3442 /// <summary> Initializes a new instance of <see cref="SmsClient"/>.</summary>
3543 /// <param name="connectionString">Connection string acquired from the Azure Communication Services resource.</param>
3644 /// <param name="options">Client option exposing <see cref="ClientOptions.Diagnostics"/>, <see cref="ClientOptions.Retry"/>, <see cref="ClientOptions.Transport"/>, etc.</param>
37- public SmsClient ( string connectionString , SmsClientOptions ? options = default )
45+ public SmsClient ( string connectionString , SmsClientOptions options )
3846 : this (
3947 options ?? new SmsClientOptions ( ) ,
4048 ConnectionString . Parse ( AssertNotNullOrEmpty ( connectionString , nameof ( connectionString ) ) ) )
@@ -44,7 +52,7 @@ public SmsClient(string connectionString, SmsClientOptions? options = default)
4452 /// <param name="endpoint">The URI of the Azure Communication Services resource.</param>
4553 /// <param name="tokenCredential">The TokenCredential used to authenticate requests, such as DefaultAzureCredential.</param>
4654 /// <param name="options">Client option exposing <see cref="ClientOptions.Diagnostics"/>, <see cref="ClientOptions.Retry"/>, <see cref="ClientOptions.Transport"/>, etc.</param>
47- public SmsClient ( Uri endpoint , TokenCredential tokenCredential , SmsClientOptions ? options = default )
55+ public SmsClient ( Uri endpoint , TokenCredential tokenCredential , SmsClientOptions options = default )
4856 : this (
4957 endpoint ,
5058 options ?? new SmsClientOptions ( ) ,
@@ -104,7 +112,7 @@ private SmsClient(Uri endpoint, SmsClientOptions options, AzureKeyCredential cre
104112 /// <exception cref="ArgumentNullException"><paramref name="from"/> is null.</exception>
105113 /// <exception cref="ArgumentNullException"><paramref name="to"/> is null.</exception>
106114 /// <exception cref="ArgumentNullException"><paramref name="message"/> is null.</exception>
107- public virtual async Task < Response < SendSmsResponse > > SendAsync ( PhoneNumberIdentifier from , PhoneNumberIdentifier to , string message , SendSmsOptions ? sendSmsOptions = null , CancellationToken cancellationToken = default )
115+ public virtual async Task < Response < SendSmsResponse > > SendAsync ( PhoneNumberIdentifier from , PhoneNumberIdentifier to , string message , SendSmsOptions sendSmsOptions = null , CancellationToken cancellationToken = default )
108116 {
109117 Argument . AssertNotNullOrEmpty ( from . PhoneNumber , nameof ( from ) ) ;
110118 Argument . AssertNotNullOrEmpty ( to . PhoneNumber , nameof ( to ) ) ;
@@ -123,7 +131,7 @@ public virtual async Task<Response<SendSmsResponse>> SendAsync(PhoneNumberIdenti
123131 /// <exception cref="ArgumentNullException"><paramref name="from"/> is null.</exception>
124132 /// <exception cref="ArgumentNullException"><paramref name="to"/> is null.</exception>
125133 /// <exception cref="ArgumentNullException"><paramref name="message"/> is null.</exception>
126- public virtual Response < SendSmsResponse > Send ( PhoneNumberIdentifier from , PhoneNumberIdentifier to , string message , SendSmsOptions ? sendSmsOptions = null , CancellationToken cancellationToken = default )
134+ public virtual Response < SendSmsResponse > Send ( PhoneNumberIdentifier from , PhoneNumberIdentifier to , string message , SendSmsOptions sendSmsOptions = null , CancellationToken cancellationToken = default )
127135 {
128136 Argument . AssertNotNullOrEmpty ( from . PhoneNumber , nameof ( from ) ) ;
129137 Argument . AssertNotNullOrEmpty ( to . PhoneNumber , nameof ( to ) ) ;
@@ -140,7 +148,7 @@ public virtual Response<SendSmsResponse> Send(PhoneNumberIdentifier from, PhoneN
140148 /// <exception cref="ArgumentNullException"><paramref name="from"/> is null.</exception>
141149 /// <exception cref="ArgumentNullException"><paramref name="to"/> is null.</exception>
142150 /// <exception cref="ArgumentNullException"><paramref name="message"/> is null.</exception>
143- public virtual async Task < Response < SendSmsResponse > > SendAsync ( PhoneNumberIdentifier from , IEnumerable < PhoneNumberIdentifier > to , string message , SendSmsOptions ? sendSmsOptions = null , CancellationToken cancellationToken = default )
151+ public virtual async Task < Response < SendSmsResponse > > SendAsync ( PhoneNumberIdentifier from , IEnumerable < PhoneNumberIdentifier > to , string message , SendSmsOptions sendSmsOptions = null , CancellationToken cancellationToken = default )
144152 {
145153 using DiagnosticScope scope = _clientDiagnostics . CreateScope ( $ "{ nameof ( SmsClient ) } .{ nameof ( Send ) } ") ;
146154 scope . Start ( ) ;
@@ -166,7 +174,7 @@ public virtual async Task<Response<SendSmsResponse>> SendAsync(PhoneNumberIdenti
166174 /// <exception cref="ArgumentNullException"><paramref name="from"/> is null.</exception>
167175 /// <exception cref="ArgumentNullException"><paramref name="to"/> is null.</exception>
168176 /// <exception cref="ArgumentNullException"><paramref name="message"/> is null.</exception>
169- public virtual Response < SendSmsResponse > Send ( PhoneNumberIdentifier from , IEnumerable < PhoneNumberIdentifier > to , string message , SendSmsOptions ? sendSmsOptions = null , CancellationToken cancellationToken = default )
177+ public virtual Response < SendSmsResponse > Send ( PhoneNumberIdentifier from , IEnumerable < PhoneNumberIdentifier > to , string message , SendSmsOptions sendSmsOptions = null , CancellationToken cancellationToken = default )
170178 {
171179 using DiagnosticScope scope = _clientDiagnostics . CreateScope ( $ "{ nameof ( SmsClient ) } .{ nameof ( Send ) } ") ;
172180 scope . Start ( ) ;
0 commit comments