Example #1
0
 /// <summary> Initializes a new instance of <see cref="ConversationClient"/>.</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 ConversationClient(Uri endpoint, TokenCredential tokenCredential, CallClientOptions options = default)
     : this(
         Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri,
         Argument.CheckNotNull(tokenCredential, nameof(tokenCredential)),
         options ?? new CallClientOptions())
 {
 }
Example #2
0
 /// <summary> Initializes a new instance of <see cref="CallClient"/>.</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 CallClient(Uri endpoint, AzureKeyCredential keyCredential, CallClientOptions options = default)
     : this(
         Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri,
         Argument.CheckNotNull(keyCredential, nameof(keyCredential)),
         options ?? new CallClientOptions())
 {
 }
Example #3
0
 private ConversationClient(string endpoint, HttpPipeline httpPipeline, CallClientOptions options)
 {
     _clientDiagnostics = new ClientDiagnostics(options);
     _pipeline          = httpPipeline;
     _resourceEndpoint  = endpoint;
     _contentDownloader = new(this);
     RestClient         = new ConversationRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion);
 }
Example #4
0
 private ConversationClient(string endpoint, AzureKeyCredential keyCredential, CallClientOptions options)
     : this(endpoint, options.BuildHttpPipeline(keyCredential), options)
 {
 }
Example #5
0
 private ConversationClient(string endpoint, TokenCredential tokenCredential, CallClientOptions options)
     : this(endpoint, options.BuildHttpPipeline(tokenCredential), options)
 {
 }
Example #6
0
 private ConversationClient(ConnectionString connectionString, CallClientOptions options)
     : this(connectionString.GetRequired("endpoint"), options.BuildHttpPipeline(connectionString), options)
 {
 }
Example #7
0
 /// <summary> Initializes a new instance of <see cref="ConversationClient"/>.</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 ConversationClient(string connectionString, CallClientOptions options)
     : this(
         ConnectionString.Parse(Argument.CheckNotNullOrEmpty(connectionString, nameof(connectionString))),
         options ?? new CallClientOptions())
 {
 }
Example #8
0
 private CallClient(string endpoint, HttpPipeline httpPipeline, CallClientOptions options)
 {
     _clientDiagnostics = new ClientDiagnostics(options);
     RestClient         = new CallRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion);
 }