Пример #1
0
 /// <summary> Endpoint for configuring a pstn number. </summary>
 /// <param name="phoneNumber"> The phone number to configure. </param>
 /// <param name="pstnConfiguration"> Definition for pstn number configuration. </param>
 /// <param name="cancellationToken"> The cancellation token to use. </param>
 /// <returns> A <see cref="Response"/>. </returns>
 public virtual Response ConfigureNumber(PstnConfiguration pstnConfiguration, PhoneNumberIdentifier phoneNumber, CancellationToken cancellationToken = default)
 {
     using DiagnosticScope scope = ClientDiagnostics.CreateScope($"{nameof(PhoneNumberAdministrationClient)}.{nameof(ConfigureNumber)}");
     scope.Start();
     try
     {
         return(RestClient.ConfigureNumber(pstnConfiguration, phoneNumber.Value, cancellationToken));
     }
     catch (Exception ex)
     {
         scope.Failed(ex);
         throw;
     }
 }
Пример #2
0
 /// <summary> Endpoint for configuring a pstn number. </summary>
 /// <param name="pstnConfiguration"> Definition for pstn number configuration. </param>
 /// <param name="phoneNumber"> The phone number to configure. </param>
 /// <param name="cancellationToken"> The cancellation token to use. </param>
 public virtual async Task <Response> ConfigureNumberAsync(PstnConfiguration pstnConfiguration, PhoneNumber phoneNumber, CancellationToken cancellationToken = default)
 {
     using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(PhoneNumberAdministrationClient)}.{nameof(ConfigureNumber)}");
     scope.Start();
     try
     {
         return(await RestClient.ConfigureNumberAsync(pstnConfiguration, phoneNumber.Value, cancellationToken).ConfigureAwait(false));
     }
     catch (Exception ex)
     {
         scope.Failed(ex);
         throw;
     }
 }