Exemplo n.º 1
0
        public async virtual Task <Response <Certificate> > UpdateAsync(CertificateUpdateOptions options, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(options, nameof(options));

            using var scope = _certificateClientDiagnostics.CreateScope("Certificate.Update");
            scope.Start();
            try
            {
                var response = await _certificateRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new Certificate(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemplo n.º 2
0
        public async virtual Task <Response <Certificate> > UpdateAsync(CertificatePatchResource certificateEnvelope, CancellationToken cancellationToken = default)
        {
            if (certificateEnvelope == null)
            {
                throw new ArgumentNullException(nameof(certificateEnvelope));
            }

            using var scope = _clientDiagnostics.CreateScope("Certificate.Update");
            scope.Start();
            try
            {
                var response = await _certificatesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateEnvelope, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new Certificate(this, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }