internal static string ToSerializedValue(this AccessPolicyUpdateKind value) { switch (value) { case AccessPolicyUpdateKind.Add: return("add"); case AccessPolicyUpdateKind.Replace: return("replace"); case AccessPolicyUpdateKind.Remove: return("remove"); } return(null); }
public virtual Response <VaultAccessPolicyParameters> UpdateAccessPolicy(AccessPolicyUpdateKind operationKind, VaultAccessPolicyParameters parameters, CancellationToken cancellationToken = default) { Argument.AssertNotNull(parameters, nameof(parameters)); using var scope = _vaultClientDiagnostics.CreateScope("VaultResource.UpdateAccessPolicy"); scope.Start(); try { var response = _vaultRestClient.UpdateAccessPolicy(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, operationKind, parameters, cancellationToken); return(response); } catch (Exception e) { scope.Failed(e); throw; } }
public async virtual Task <Response <VaultAccessPolicyParameters> > UpdateAccessPolicyAsync(AccessPolicyUpdateKind operationKind, VaultAccessPolicyParameters parameters, CancellationToken cancellationToken = default) { if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } using var scope = _vaultClientDiagnostics.CreateScope("Vault.UpdateAccessPolicy"); scope.Start(); try { var response = await _vaultRestClient.UpdateAccessPolicyAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, operationKind, parameters, cancellationToken).ConfigureAwait(false); return(response); } catch (Exception e) { scope.Failed(e); throw; } }
/// <summary> /// Update access policies in a key vault in the specified subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the Resource Group to which the vault belongs. /// </param> /// <param name='vaultName'> /// Name of the vault /// </param> /// <param name='operationKind'> /// Name of the operation. Possible values include: 'add', 'replace', 'remove' /// </param> /// <param name='properties'> /// Properties of the access policy /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <VaultAccessPolicyParametersInner> UpdateAccessPolicyAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyPropertiesInner properties, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateAccessPolicyWithHttpMessagesAsync(resourceGroupName, vaultName, operationKind, properties, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public virtual Response <VaultAccessPolicyParameters> UpdateAccessPolicy(string resourceGroupName, string vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyParameters parameters, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VaultsOperations.UpdateAccessPolicy"); scope.Start(); try { return(RestClient.UpdateAccessPolicy(resourceGroupName, vaultName, operationKind, parameters, cancellationToken)); } catch (Exception e) { scope.Failed(e); throw; } }
public static string ToSerialString(this AccessPolicyUpdateKind value) => value switch {
/// <summary> /// Update access policies in a key vault in the specified subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the Resource Group to which the vault belongs. /// </param> /// <param name='vaultName'> /// Name of the vault /// </param> /// <param name='operationKind'> /// Name of the operation. Possible values include: 'add', 'replace', 'remove' /// </param> /// <param name='parameters'> /// Access policy to merge into the vault /// </param> public static VaultAccessPolicyParameters UpdateAccessPolicy(this IVaultsOperations operations, string resourceGroupName, string vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyParameters parameters) { return(operations.UpdateAccessPolicyAsync(resourceGroupName, vaultName, operationKind, parameters).GetAwaiter().GetResult()); }
public Task <AzureOperationResponse <VaultAccessPolicyParameters> > UpdateAccessPolicyWithHttpMessagesAsync(string resourceGroupName, string vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyParameters parameters, Dictionary <string, List <string> > customHeaders = null, CancellationToken cancellationToken = default) { throw new NotImplementedException(); }
public virtual async Task <Response <VaultAccessPolicyParameters> > UpdateAccessPolicyAsync(string resourceGroupName, string vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyParameters parameters, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VaultsClient.UpdateAccessPolicy"); scope.Start(); try { return(await RestClient.UpdateAccessPolicyAsync(resourceGroupName, vaultName, operationKind, parameters, cancellationToken).ConfigureAwait(false)); } catch (Exception e) { scope.Failed(e); throw; } }
/// <summary> /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider" /// /> and <see cref="ignoreCase" /> /// </summary> /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param> /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param> /// <param name="formatProvider">not used by this TypeConverter.</param> /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param> /// <returns> /// an instance of <see cref="AccessPolicyUpdateKind" />, or <c>null</c> if there is no suitable conversion. /// </returns> public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AccessPolicyUpdateKind.CreateFrom(sourceValue);