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)); }
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; } }
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; } }