public virtual async Task <Response <CheckNameAvailabilityResult> > CheckDisasterRecoveryNameAvailabilityAsync(CheckNameAvailabilityOptions options, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(options, nameof(options));

            using var scope = _disasterRecoveryConfigsClientDiagnostics.CreateScope("EventHubNamespaceResource.CheckDisasterRecoveryNameAvailability");
            scope.Start();
            try
            {
                var response = await _disasterRecoveryConfigsRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options, cancellationToken).ConfigureAwait(false);

                return(response);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Ejemplo n.º 2
0
        public async virtual Task <Response <CheckNameAvailabilityResult> > CheckNameAvailabilityDisasterRecoveryConfigAsync(CheckNameAvailabilityOptions parameters, CancellationToken cancellationToken = default)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            using var scope = _disasterRecoveryConfigsClientDiagnostics.CreateScope("EventHubNamespace.CheckNameAvailabilityDisasterRecoveryConfig");
            scope.Start();
            try
            {
                var response = await _disasterRecoveryConfigsRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, parameters, cancellationToken).ConfigureAwait(false);

                return(response);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }