/// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     this.CommitmentAssociations = new CommitmentAssociationsOperations(this);
     this.CommitmentPlans        = new CommitmentPlansOperations(this);
     this.UsageHistory           = new UsageHistoryOperations(this);
     this.BaseUri        = new System.Uri("https://management.azure.com");
     this.ApiVersion     = "2016-05-01-preview";
     this.AcceptLanguage = "en-US";
     this.LongRunningOperationRetryTimeout = 30;
     this.GenerateClientRequestId          = true;
     SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(),
         Converters            = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter>
         {
             new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(),
         Converters            = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter>
         {
             new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter());
 }
 /// <summary>
 /// Retrieves the usage history for an Azure ML commitment plan.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Microsoft.Rest.Azure.IPage <PlanUsageHistory> > ListNextAsync(this IUsageHistoryOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Retrieves the usage history for an Azure ML commitment plan.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static Microsoft.Rest.Azure.IPage <PlanUsageHistory> ListNext(this IUsageHistoryOperations operations, string nextPageLink)
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsageHistoryOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieves the usage history for an Azure ML commitment plan.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='commitmentPlanName'>
 /// The Azure ML commitment plan name.
 /// </param>
 /// <param name='skipToken'>
 /// Continuation token for pagination.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Microsoft.Rest.Azure.IPage <PlanUsageHistory> > ListAsync(this IUsageHistoryOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, skipToken, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Retrieves the usage history for an Azure ML commitment plan.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='commitmentPlanName'>
 /// The Azure ML commitment plan name.
 /// </param>
 /// <param name='skipToken'>
 /// Continuation token for pagination.
 /// </param>
 public static Microsoft.Rest.Azure.IPage <PlanUsageHistory> List(this IUsageHistoryOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string))
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsageHistoryOperations)s).ListAsync(resourceGroupName, commitmentPlanName, skipToken), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }