/// <summary> /// Creates an authorization policy or updates an existing authorization /// policy. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='hubName'> /// The name of the hub. /// </param> /// <param name='authorizationPolicyName'> /// The name of the policy. /// </param> /// <param name='parameters'> /// Parameters supplied to the CreateOrUpdate authorization policy operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <AuthorizationPolicyResourceFormat> CreateOrUpdateAsync(this IAuthorizationPoliciesOperations operations, string resourceGroupName, string hubName, string authorizationPolicyName, AuthorizationPolicyResourceFormat parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, hubName, authorizationPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates an authorization policy or updates an existing authorization /// policy. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='hubName'> /// The name of the hub. /// </param> /// <param name='authorizationPolicyName'> /// The name of the policy. /// </param> /// <param name='parameters'> /// Parameters supplied to the CreateOrUpdate authorization policy operation. /// </param> public static AuthorizationPolicyResourceFormat CreateOrUpdate(this IAuthorizationPoliciesOperations operations, string resourceGroupName, string hubName, string authorizationPolicyName, AuthorizationPolicyResourceFormat parameters) { return(operations.CreateOrUpdateAsync(resourceGroupName, hubName, authorizationPolicyName, parameters).GetAwaiter().GetResult()); }