예제 #1
0
 public static ImmutabilityPolicy GetImmutabilityPolicy(this ArmClient client, ResourceIdentifier id)
 {
     return(client.GetClient(() =>
     {
         ImmutabilityPolicy.ValidateResourceId(id);
         return new ImmutabilityPolicy(client, id);
     }
                             ));
 }
 public static ImmutabilityPolicy GetImmutabilityPolicy(this ArmClient armClient, ResourceIdentifier id)
 {
     ImmutabilityPolicy.ValidateResourceId(id);
     return(new ImmutabilityPolicy(armClient, id));
 }
예제 #3
0
        public virtual Response <ImmutabilityPolicy> ExtendImmutabilityPolicy(string ifMatch, ImmutabilityPolicy parameters = null, CancellationToken cancellationToken = default)
        {
            if (ifMatch == null)
            {
                throw new ArgumentNullException(nameof(ifMatch));
            }

            using var scope = _clientDiagnostics.CreateScope("BlobContainer.ExtendImmutabilityPolicy");
            scope.Start();
            try
            {
                var response = _restClient.ExtendImmutabilityPolicy(Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, ifMatch, parameters, cancellationToken);
                return(response);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
예제 #4
0
        public virtual async Task <Response <ImmutabilityPolicy> > CreateOrUpdateImmutabilityPolicyAsync(string ifMatch = null, ImmutabilityPolicy parameters = null, CancellationToken cancellationToken = default)
        {
            using var scope = _clientDiagnostics.CreateScope("BlobContainer.CreateOrUpdateImmutabilityPolicy");
            scope.Start();
            try
            {
                var response = await _restClient.CreateOrUpdateImmutabilityPolicyAsync(Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, ifMatch, parameters, cancellationToken).ConfigureAwait(false);

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