/// <summary> Initializes a new instance of <see cref="SmsClient"/>.</summary>
 /// <param name="endpoint">The URI of the Azure Communication Services resource.</param>
 /// <param name="tokenCredential">The TokenCredential used to authenticate requests, such as DefaultAzureCredential.</param>
 /// <param name="options">Client option exposing <see cref="ClientOptions.Diagnostics"/>, <see cref="ClientOptions.Retry"/>, <see cref="ClientOptions.Transport"/>, etc.</param>
 public SmsClient(Uri endpoint, TokenCredential tokenCredential, SmsClientOptions options = default)
     : this(
         AssertNotNull(endpoint, nameof(endpoint)).AbsoluteUri,
         AssertNotNull(tokenCredential, nameof(tokenCredential)),
         options ?? new SmsClientOptions())
 {
 }
Exemple #2
0
 /// <summary> Initializes a new instance of <see cref="SmsClient"/>.</summary>
 /// <param name="endpoint">The URI of the Azure Communication Services resource.</param>
 /// <param name="keyCredential">The <see cref="AzureKeyCredential"/> used to authenticate requests.</param>
 /// <param name="options">Client option exposing <see cref="ClientOptions.Diagnostics"/>, <see cref="ClientOptions.Retry"/>, <see cref="ClientOptions.Transport"/>, etc.</param>
 public SmsClient(Uri endpoint, AzureKeyCredential keyCredential, SmsClientOptions options = default)
     : this(
         Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri,
         Argument.CheckNotNull(keyCredential, nameof(keyCredential)),
         options ?? new SmsClientOptions())
 {
 }
 private SmsClient(SmsClientOptions options, ConnectionString connectionString)
     : this(
         clientDiagnostics : new ClientDiagnostics(options),
         pipeline : options.BuildHttpPipeline(connectionString),
         endpointUrl : connectionString.GetRequired("endpoint"))
 {
 }
 /// <summary> Initializes a new instance of <see cref="SmsClient"/>.</summary>
 /// <param name="endpoint">The URI of the Azure Communication Services resource.</param>
 /// <param name="tokenCredential">The TokenCredential used to authenticate requests, such as DefaultAzureCredential.</param>
 /// <param name="options">Client option exposing <see cref="ClientOptions.Diagnostics"/>, <see cref="ClientOptions.Retry"/>, <see cref="ClientOptions.Transport"/>, etc.</param>
 public SmsClient(Uri endpoint, TokenCredential tokenCredential, SmsClientOptions options = default)
     : this(
         endpoint,
         options ?? new SmsClientOptions(),
         tokenCredential)
 {
 }
 /// <summary> Initializes a new instance of <see cref="SmsClient"/>.</summary>
 /// <param name="endpoint">The URI of the Azure Communication Services resource.</param>
 /// <param name="keyCredential">The <see cref="AzureKeyCredential"/> used to authenticate requests.</param>
 /// <param name="options">Client option exposing <see cref="ClientOptions.Diagnostics"/>, <see cref="ClientOptions.Retry"/>, <see cref="ClientOptions.Transport"/>, etc.</param>
 public SmsClient(Uri endpoint, AzureKeyCredential keyCredential, SmsClientOptions options = default)
     : this(
         AssertNotNull(endpoint, nameof(endpoint)),
         options ?? new SmsClientOptions(),
         AssertNotNull(keyCredential, nameof(keyCredential)))
 {
 }
 private SmsClient(Uri endpoint, SmsClientOptions options, AzureKeyCredential credential)
 {
     _clientDiagnostics = new ClientDiagnostics(options);
     RestClient         = new SmsRestClient(
         _clientDiagnostics,
         options.BuildHttpPipeline(credential),
         endpoint.AbsoluteUri);
 }
        private SmsClient(Uri endpoint, SmsClientOptions options, TokenCredential tokenCredential)
        {
            Argument.AssertNotNull(endpoint, nameof(endpoint));
            Argument.AssertNotNull(tokenCredential, nameof(tokenCredential));

            _clientDiagnostics = new ClientDiagnostics(options);
            RestClient         = new SmsRestClient(
                _clientDiagnostics,
                options.BuildHttpPipeline(tokenCredential),
                endpoint.AbsoluteUri);
        }
 private SmsClient(string endpoint, HttpPipeline httpPipeline, SmsClientOptions options)
 {
     _clientDiagnostics = new ClientDiagnostics(options);
     RestClient         = new SmsRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion);
 }
 private SmsClient(string endpoint, AzureKeyCredential keyCredential, SmsClientOptions options)
     : this(endpoint, options.BuildHttpPipeline(keyCredential), options)
 {
 }
 private SmsClient(string endpoint, TokenCredential tokenCredential, SmsClientOptions options)
     : this(endpoint, options.BuildHttpPipeline(tokenCredential), options)
 {
 }
 private SmsClient(ConnectionString connectionString, SmsClientOptions options)
     : this(connectionString.GetRequired("endpoint"), options.BuildHttpPipeline(connectionString), options)
 {
 }
 /// <summary> Initializes a new instance of <see cref="SmsClient"/>.</summary>
 /// <param name="connectionString">Connection string acquired from the Azure Communication Services resource.</param>
 /// <param name="options">Client option exposing <see cref="ClientOptions.Diagnostics"/>, <see cref="ClientOptions.Retry"/>, <see cref="ClientOptions.Transport"/>, etc.</param>
 public SmsClient(string connectionString, SmsClientOptions options)
     : this(
         ConnectionString.Parse(AssertNotNullOrEmpty(connectionString, nameof(connectionString))),
         options ?? new SmsClientOptions())
 {
 }