Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a short codes client with a token credential.
 /// <param name="endpoint">The URI of the Azure Communication Services resource.</param>
 /// <param name="tokenCredential">The <see cref="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>
 /// </summary>
 public ShortCodesClient(Uri endpoint, TokenCredential tokenCredential, ShortCodesClientOptions options = default)
     : this(
         Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri,
         Argument.CheckNotNull(tokenCredential, nameof(tokenCredential)),
         options ?? new ShortCodesClientOptions())
 {
 }
Ejemplo n.º 2
0
 private ShortCodesClient(string endpoint, HttpPipeline httpPipeline, ShortCodesClientOptions options)
     : this(new ClientDiagnostics(options), httpPipeline, endpoint, options.ApiVersion)
 {
 }
Ejemplo n.º 3
0
 private ShortCodesClient(string endpoint, TokenCredential tokenCredential, ShortCodesClientOptions options)
     : this(endpoint, options.BuildHttpPipeline(tokenCredential), options)
 {
 }
Ejemplo n.º 4
0
 private ShortCodesClient(string endpoint, AzureKeyCredential keyCredential, ShortCodesClientOptions options)
     : this(endpoint, options.BuildHttpPipeline(keyCredential), options)
 {
 }
Ejemplo n.º 5
0
 private ShortCodesClient(ConnectionString connectionString, ShortCodesClientOptions options)
     : this(connectionString.GetRequired("endpoint"), options.BuildHttpPipeline(connectionString), options)
 {
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a short codes client with an Azure resource connection string and client options.
 /// </summary>
 public ShortCodesClient(string connectionString, ShortCodesClientOptions options)
     : this(
         ConnectionString.Parse(Argument.CheckNotNullOrEmpty(connectionString, nameof(connectionString))),
         options ?? new ShortCodesClientOptions())
 {
 }