/// <summary>
 /// Creates a nat rule to a scalable vpn 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 VpnGateway.
 /// </param>
 /// <param name='gatewayName'>
 /// 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 VpnGatewayNatRule CreateOrUpdate(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Creates a nat rule to a scalable vpn 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 VpnGateway.
 /// </param>
 /// <param name='gatewayName'>
 /// 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 <VpnGatewayNatRule> BeginCreateOrUpdateAsync(this INatRulesOperations operations, string resourceGroupName, string gatewayName, string natRuleName, VpnGatewayNatRule natRuleParameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }