/// <summary>
 /// The Reset Virtual network Gateway shared key operation resets the
 /// shared key on the virtual network gateway for the specified
 /// vitrual network connection to the specified local network in
 /// Windows Azure.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154114.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.VirtualNetworks.IGatewayOperations.
 /// </param>
 /// <param name='virtualNetworkName'>
 /// The name of the virtual network for this gateway.
 /// </param>
 /// <param name='localNetworkName'>
 /// The name of the local network.
 /// </param>
 /// <param name='parameters'>
 /// The parameters to the Virtual Network Gateway Reset Shared Key
 /// request.
 /// </param>
 /// <returns>
 /// A standard storage response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task<GatewayOperationResponse> BeginResetSharedKeyAsync(this IGatewayOperations operations, string virtualNetworkName, string localNetworkName, GatewayResetSharedKeyParameters parameters)
 {
     return operations.BeginResetSharedKeyAsync(virtualNetworkName, localNetworkName, parameters, CancellationToken.None);
 }
 /// <summary>
 /// The Reset Virtual network Gateway shared key operation resets the
 /// shared key on the virtual network gateway for the specified
 /// vitrual network connection to the specified local network in
 /// Windows Azure.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154114.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.VirtualNetworks.IGatewayOperations.
 /// </param>
 /// <param name='virtualNetworkName'>
 /// The name of the virtual network for this gateway.
 /// </param>
 /// <param name='localNetworkName'>
 /// The name of the local network.
 /// </param>
 /// <param name='parameters'>
 /// The parameters to the Virtual Network Gateway Reset Shared Key
 /// request.
 /// </param>
 /// <returns>
 /// A standard storage response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static GatewayOperationResponse BeginResetSharedKey(this IGatewayOperations operations, string virtualNetworkName, string localNetworkName, GatewayResetSharedKeyParameters parameters)
 {
     try
     {
         return operations.BeginResetSharedKeyAsync(virtualNetworkName, localNetworkName, parameters).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }