Exemplo n.º 1
0
        public virtual AfdCustomDomainUpdateOperation Update(bool waitForCompletion, AfdCustomDomainUpdateOptions customDomainUpdateProperties, CancellationToken cancellationToken = default)
        {
            if (customDomainUpdateProperties == null)
            {
                throw new ArgumentNullException(nameof(customDomainUpdateProperties));
            }

            using var scope = _clientDiagnostics.CreateScope("AfdCustomDomain.Update");
            scope.Start();
            try
            {
                var response  = _afdCustomDomainsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, customDomainUpdateProperties, cancellationToken);
                var operation = new AfdCustomDomainUpdateOperation(this, _clientDiagnostics, Pipeline, _afdCustomDomainsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, customDomainUpdateProperties).Request, response);
                if (waitForCompletion)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
        public virtual ArmOperation <AfdCustomDomainResource> Update(WaitUntil waitUntil, AfdCustomDomainPatch patch, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(patch, nameof(patch));

            using var scope = _afdCustomDomainClientDiagnostics.CreateScope("AfdCustomDomainResource.Update");
            scope.Start();
            try
            {
                var response  = _afdCustomDomainRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken);
                var operation = new CdnArmOperation <AfdCustomDomainResource>(new AfdCustomDomainOperationSource(Client), _afdCustomDomainClientDiagnostics, Pipeline, _afdCustomDomainRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemplo n.º 3
0
        public virtual ArmOperation <AfdCustomDomain> Update(bool waitForCompletion, AfdCustomDomainUpdateOptions options, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(options, nameof(options));

            using var scope = _afdCustomDomainClientDiagnostics.CreateScope("AfdCustomDomain.Update");
            scope.Start();
            try
            {
                var response  = _afdCustomDomainRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options, cancellationToken);
                var operation = new CdnArmOperation <AfdCustomDomain>(new AfdCustomDomainOperationSource(Client), _afdCustomDomainClientDiagnostics, Pipeline, _afdCustomDomainRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options).Request, response, OperationFinalStateVia.OriginalUri);
                if (waitForCompletion)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }