/// <summary>
 /// The Begin Update Diagnostics operation begins an asynchronous
 /// operation to starta diagnostics session for the specified virtual
 /// network gateway in Azure.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154119.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IGatewayOperations.
 /// </param>
 /// <param name='networkName'>
 /// Required. The name of the virtual network for this gateway.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Begin Creating Virtual Network
 /// Gateway operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task<GatewayOperationResponse> BeginUpdateDiagnosticsAsync(this IGatewayOperations operations, string networkName, UpdateGatewayPublicDiagnostics parameters)
 {
     return operations.BeginUpdateDiagnosticsAsync(networkName, parameters, CancellationToken.None);
 }
 /// <summary>
 /// The Begin Update Diagnostics operation begins an asynchronous
 /// operation to starta diagnostics session for the specified virtual
 /// network gateway in Azure.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154119.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IGatewayOperations.
 /// </param>
 /// <param name='networkName'>
 /// Required. The name of the virtual network for this gateway.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Begin Creating Virtual Network
 /// Gateway operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static GatewayOperationResponse BeginUpdateDiagnostics(this IGatewayOperations operations, string networkName, UpdateGatewayPublicDiagnostics parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IGatewayOperations)s).BeginUpdateDiagnosticsAsync(networkName, parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }