/// <summary>
 /// The Put Metric Settings operation creates or updates the metric
 /// settings for the resource.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Monitoring.Metrics.IMetricSettingOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Metric settings to be created or updated.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse CreateOrUpdate(this IMetricSettingOperations operations, MetricSettingsPutParameters parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IMetricSettingOperations)s).CreateOrUpdateAsync(parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// The Put Metric Settings operation creates or updates the metric
 /// settings for the resource.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Monitoring.Metrics.IMetricSettingOperations.
 /// </param>
 /// <param name='parameters'>
 /// Metric settings to be created or updated.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse CreateOrUpdate(this IMetricSettingOperations operations, MetricSettingsPutParameters parameters)
 {
     try
     {
         return operations.CreateOrUpdateAsync(parameters).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Put Metric Settings operation creates or updates the metric
 /// settings for the resource.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Monitoring.Metrics.IMetricSettingOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Metric settings to be created or updated.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task<AzureOperationResponse> CreateOrUpdateAsync(this IMetricSettingOperations operations, MetricSettingsPutParameters parameters)
 {
     return operations.CreateOrUpdateAsync(parameters, CancellationToken.None);
 }