public virtual Response <Certificate> Update(CertificateUpdateOptions options, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(options, nameof(options));

            using var scope = _certificateClientDiagnostics.CreateScope("Certificate.Update");
            scope.Start();
            try
            {
                var response = _certificateRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options, cancellationToken);
                return(Response.FromValue(new Certificate(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Example #2
0
        public virtual Response <Certificate> Update(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 = _certificatesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateEnvelope, cancellationToken);
                return(Response.FromValue(new Certificate(this, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }