/// <summary> /// Creates a nat rule to a scalable virtual network gateway if it doesn't /// exist else updates the existing nat rules. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name of the Virtual Network Gateway. /// </param> /// <param name='virtualNetworkGatewayName'> /// The name of the gateway. /// </param> /// <param name='natRuleName'> /// The name of the nat rule. /// </param> /// <param name='natRuleParameters'> /// Parameters supplied to create or Update a Nat Rule. /// </param> public static VirtualNetworkGatewayNatRule CreateOrUpdate(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters) { return(operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters).GetAwaiter().GetResult()); }
/// <summary> /// Creates a nat rule to a scalable virtual network gateway if it doesn't /// exist else updates the existing nat rules. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name of the Virtual Network Gateway. /// </param> /// <param name='virtualNetworkGatewayName'> /// The name of the gateway. /// </param> /// <param name='natRuleName'> /// The name of the nat rule. /// </param> /// <param name='natRuleParameters'> /// Parameters supplied to create or Update a Nat Rule. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <VirtualNetworkGatewayNatRule> BeginCreateOrUpdateAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }