diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/AzureMLCommitmentPlansManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/AzureMLCommitmentPlansManagementClient.cs
index 8443abc0cdc68..cc2a7be383015 100644
--- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/AzureMLCommitmentPlansManagementClient.cs
+++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/AzureMLCommitmentPlansManagementClient.cs
@@ -1,17 +1,25 @@
+//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
+//
namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans
{
- using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
+ using Microsoft.Rest.Serialization;
using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
///
/// These APIs allow end users to operate on Azure Machine Learning
@@ -21,7 +29,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans
/// associations between commitment plans, and retrieving commitment plan
/// usage history.
///
- public partial class AzureMLCommitmentPlansManagementClient : Microsoft.Rest.ServiceClient, IAzureMLCommitmentPlansManagementClient, IAzureClient
+ public partial class AzureMLCommitmentPlansManagementClient : ServiceClient, IAzureMLCommitmentPlansManagementClient, IAzureClient
{
///
/// The base URI of the service.
@@ -31,17 +39,17 @@ public partial class AzureMLCommitmentPlansManagementClient : Microsoft.Rest.Ser
///
/// Gets or sets json serialization settings.
///
- public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; }
+ public JsonSerializerSettings SerializationSettings { get; private set; }
///
/// Gets or sets json deserialization settings.
///
- public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; }
+ public JsonSerializerSettings DeserializationSettings { get; private set; }
///
/// Credentials needed for the client to connect to Azure.
///
- public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; }
+ public ServiceClientCredentials Credentials { get; private set; }
///
/// Azure Subscription ID.
@@ -54,22 +62,33 @@ public partial class AzureMLCommitmentPlansManagementClient : Microsoft.Rest.Ser
public string ApiVersion { get; private set; }
///
- /// Gets or sets the preferred language for the response.
+ /// The preferred language for the response.
///
public string AcceptLanguage { get; set; }
///
- /// Gets or sets the retry timeout in seconds for Long Running Operations.
- /// Default value is 30.
+ /// The retry timeout in seconds for Long Running Operations. Default value is
+ /// 30.
///
public int? LongRunningOperationRetryTimeout { get; set; }
///
- /// When set to true a unique x-ms-client-request-id value is generated and
- /// included in each request. Default is true.
+ /// Whether a unique x-ms-client-request-id should be generated. When set to
+ /// true a unique x-ms-client-request-id value is generated and included in
+ /// each request. Default is true.
///
public bool? GenerateClientRequestId { get; set; }
+ ///
+ /// Gets the IOperations.
+ ///
+ public virtual IOperations Operations { get; private set; }
+
+ ///
+ /// Gets the ISkusOperations.
+ ///
+ public virtual ISkusOperations Skus { get; private set; }
+
///
/// Gets the ICommitmentAssociationsOperations.
///
@@ -85,15 +104,28 @@ public partial class AzureMLCommitmentPlansManagementClient : Microsoft.Rest.Ser
///
public virtual IUsageHistoryOperations UsageHistory { get; private set; }
+ ///
+ /// Initializes a new instance of the AzureMLCommitmentPlansManagementClient class.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling AzureMLCommitmentPlansManagementClient.Dispose(). False: will not dispose provided httpClient
+ protected AzureMLCommitmentPlansManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
+ {
+ Initialize();
+ }
+
///
/// Initializes a new instance of the AzureMLCommitmentPlansManagementClient class.
///
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
- protected AzureMLCommitmentPlansManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers)
+ protected AzureMLCommitmentPlansManagementClient(params DelegatingHandler[] handlers) : base(handlers)
{
- this.Initialize();
+ Initialize();
}
///
@@ -105,9 +137,9 @@ protected AzureMLCommitmentPlansManagementClient(params System.Net.Http.Delegati
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
- protected AzureMLCommitmentPlansManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers)
+ protected AzureMLCommitmentPlansManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
{
- this.Initialize();
+ Initialize();
}
///
@@ -122,13 +154,13 @@ protected AzureMLCommitmentPlansManagementClient(System.Net.Http.HttpClientHandl
///
/// Thrown when a required parameter is null
///
- protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
+ protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
{
throw new System.ArgumentNullException("baseUri");
}
- this.BaseUri = baseUri;
+ BaseUri = baseUri;
}
///
@@ -146,13 +178,13 @@ protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, params Syst
///
/// Thrown when a required parameter is null
///
- protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
{
throw new System.ArgumentNullException("baseUri");
}
- this.BaseUri = baseUri;
+ BaseUri = baseUri;
}
///
@@ -167,16 +199,43 @@ protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, System.Net.
///
/// Thrown when a required parameter is null
///
- public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
+ public AzureMLCommitmentPlansManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
{
if (credentials == null)
{
throw new System.ArgumentNullException("credentials");
}
- this.Credentials = credentials;
- if (this.Credentials != null)
+ Credentials = credentials;
+ if (Credentials != null)
{
- this.Credentials.InitializeServiceClient(this);
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the AzureMLCommitmentPlansManagementClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling AzureMLCommitmentPlansManagementClient.Dispose(). False: will not dispose provided httpClient
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public AzureMLCommitmentPlansManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
}
}
@@ -195,16 +254,16 @@ public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCreden
///
/// Thrown when a required parameter is null
///
- public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ public AzureMLCommitmentPlansManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (credentials == null)
{
throw new System.ArgumentNullException("credentials");
}
- this.Credentials = credentials;
- if (this.Credentials != null)
+ Credentials = credentials;
+ if (Credentials != null)
{
- this.Credentials.InitializeServiceClient(this);
+ Credentials.InitializeServiceClient(this);
}
}
@@ -223,7 +282,7 @@ public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCreden
///
/// Thrown when a required parameter is null
///
- public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
+ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
{
@@ -233,11 +292,11 @@ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest
{
throw new System.ArgumentNullException("credentials");
}
- this.BaseUri = baseUri;
- this.Credentials = credentials;
- if (this.Credentials != null)
+ BaseUri = baseUri;
+ Credentials = credentials;
+ if (Credentials != null)
{
- this.Credentials.InitializeServiceClient(this);
+ Credentials.InitializeServiceClient(this);
}
}
@@ -259,7 +318,7 @@ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest
///
/// Thrown when a required parameter is null
///
- public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
{
@@ -269,11 +328,11 @@ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest
{
throw new System.ArgumentNullException("credentials");
}
- this.BaseUri = baseUri;
- this.Credentials = credentials;
- if (this.Credentials != null)
+ BaseUri = baseUri;
+ Credentials = credentials;
+ if (Credentials != null)
{
- this.Credentials.InitializeServiceClient(this);
+ Credentials.InitializeServiceClient(this);
}
}
@@ -286,41 +345,43 @@ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest
///
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
+ Operations = new Operations(this);
+ Skus = new SkusOperations(this);
+ CommitmentAssociations = new CommitmentAssociationsOperations(this);
+ CommitmentPlans = new CommitmentPlansOperations(this);
+ UsageHistory = new UsageHistoryOperations(this);
+ BaseUri = new System.Uri("https://management.azure.com");
+ ApiVersion = "2016-05-01-preview";
+ AcceptLanguage = "en-US";
+ LongRunningOperationRetryTimeout = 30;
+ GenerateClientRequestId = true;
+ SerializationSettings = new 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
+ ContractResolver = new ReadOnlyJsonContractResolver(),
+ Converters = new List
{
- new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter()
+ new Iso8601TimeSpanConverter()
}
};
- DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings
+ DeserializationSettings = new 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
+ ContractResolver = new ReadOnlyJsonContractResolver(),
+ Converters = new List
{
- new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter()
+ new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
- DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter());
- }
+ DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
+ }
}
}
diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperations.cs
index d9d3b89dc083c..744628259c4ca 100644
--- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperations.cs
+++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperations.cs
@@ -1,22 +1,31 @@
+//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
+//
namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans
{
- using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
///
/// CommitmentAssociationsOperations operations.
///
- internal partial class CommitmentAssociationsOperations : Microsoft.Rest.IServiceOperations, ICommitmentAssociationsOperations
+ internal partial class CommitmentAssociationsOperations : IServiceOperations, ICommitmentAssociationsOperations
{
///
/// Initializes a new instance of the CommitmentAssociationsOperations class.
@@ -29,11 +38,11 @@ internal partial class CommitmentAssociationsOperations : Microsoft.Rest.IServic
///
internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- this.Client = client;
+ Client = client;
}
///
@@ -42,7 +51,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
public AzureMLCommitmentPlansManagementClient Client { get; private set; }
///
- /// Gets a commitment association.
+ /// Get a commitment association.
///
///
/// The resource group name.
@@ -59,87 +68,92 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
/// Thrown when a required parameter is null
///
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (this.Client.SubscriptionId == null)
+ if (Client.SubscriptionId == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (resourceGroupName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (commitmentPlanName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName");
}
if (commitmentAssociationName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentAssociationName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "commitmentAssociationName");
}
- if (this.Client.ApiVersion == null)
+ if (Client.ApiVersion == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
- bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
- System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("commitmentPlanName", commitmentPlanName);
tracingParameters.Add("commitmentAssociationName", commitmentAssociationName);
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
- var _baseUrl = this.Client.BaseUri.AbsoluteUri;
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations/{commitmentAssociationName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName));
_url = _url.Replace("{commitmentAssociationName}", System.Uri.EscapeDataString(commitmentAssociationName));
- System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
- if (this.Client.ApiVersion != null)
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
- _url += "?" + string.Join("&", _queryParameters);
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
- System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (this.Client.AcceptLanguage != null)
+ if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
+
+
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -155,51 +169,51 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (this.Client.Credentials != null)
+ if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (Newtonsoft.Json.JsonException)
+ catch (JsonException)
{
// Ignore the exception
}
- ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -209,7 +223,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -222,21 +236,21 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
- catch (Newtonsoft.Json.JsonException ex)
+ catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
@@ -259,86 +273,91 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
/// Thrown when a required parameter is null
///
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (this.Client.SubscriptionId == null)
+ if (Client.SubscriptionId == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (resourceGroupName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (commitmentPlanName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName");
}
- if (this.Client.ApiVersion == null)
+ if (Client.ApiVersion == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
- bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
- System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("commitmentPlanName", commitmentPlanName);
tracingParameters.Add("skipToken", skipToken);
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
// Construct URL
- var _baseUrl = this.Client.BaseUri.AbsoluteUri;
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName));
- System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ List _queryParameters = new List();
if (skipToken != null)
{
_queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken)));
}
- if (this.Client.ApiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
- _url += "?" + string.Join("&", _queryParameters);
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
- System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (this.Client.AcceptLanguage != null)
+ if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
+
+
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -354,51 +373,51 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (this.Client.Credentials != null)
+ if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (Newtonsoft.Json.JsonException)
+ catch (JsonException)
{
// Ignore the exception
}
- ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -408,7 +427,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -421,27 +440,27 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
- catch (Newtonsoft.Json.JsonException ex)
+ catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
///
- /// Re-parents a commitment association from one commitment plan to another.
+ /// Re-parent a commitment association from one commitment plan to another.
///
///
/// The resource group name.
@@ -452,8 +471,9 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
///
/// The commitment association name.
///
- ///
- /// The move request payload.
+ ///
+ /// The ARM ID of the commitment plan to re-parent the commitment association
+ /// to.
///
///
/// Headers that will be added to request.
@@ -461,92 +481,98 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
/// Thrown when a required parameter is null
///
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task> MoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, MoveCommitmentAssociationRequest movePayload, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async Task> MoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, string destinationPlanId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (this.Client.SubscriptionId == null)
+ if (Client.SubscriptionId == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (resourceGroupName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (commitmentPlanName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName");
}
if (commitmentAssociationName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentAssociationName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "commitmentAssociationName");
}
- if (this.Client.ApiVersion == null)
+ if (Client.ApiVersion == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
- if (movePayload == null)
+ MoveCommitmentAssociationRequest movePayload = new MoveCommitmentAssociationRequest();
+ if (destinationPlanId != null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "movePayload");
+ movePayload.DestinationPlanId = destinationPlanId;
}
// Tracing
- bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
- System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("commitmentPlanName", commitmentPlanName);
tracingParameters.Add("commitmentAssociationName", commitmentAssociationName);
tracingParameters.Add("movePayload", movePayload);
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Move", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Move", tracingParameters);
}
// Construct URL
- var _baseUrl = this.Client.BaseUri.AbsoluteUri;
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations/{commitmentAssociationName}/move").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName));
_url = _url.Replace("{commitmentAssociationName}", System.Uri.EscapeDataString(commitmentAssociationName));
- System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
- if (this.Client.ApiVersion != null)
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
- _url += "?" + string.Join("&", _queryParameters);
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
- System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("POST");
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (this.Client.AcceptLanguage != null)
+ if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
+
+
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -563,56 +589,56 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
string _requestContent = null;
if(movePayload != null)
{
- _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(movePayload, this.Client.SerializationSettings);
- _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(movePayload, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
// Set Credentials
- if (this.Client.Credentials != null)
+ if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (Newtonsoft.Json.JsonException)
+ catch (JsonException)
{
// Ignore the exception
}
- ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -622,7 +648,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -635,21 +661,21 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
- catch (Newtonsoft.Json.JsonException ex)
+ catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
@@ -666,61 +692,66 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
/// Thrown when a required parameter is null
///
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink");
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
}
// Tracing
- bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
- System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
_url = _url.Replace("{nextLink}", nextPageLink);
- System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ List _queryParameters = new List();
if (_queryParameters.Count > 0)
{
- _url += "?" + string.Join("&", _queryParameters);
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
- System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (this.Client.AcceptLanguage != null)
+ if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
+
+
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -736,51 +767,51 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (this.Client.Credentials != null)
+ if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (Newtonsoft.Json.JsonException)
+ catch (JsonException)
{
// Ignore the exception
}
- ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -790,7 +821,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -803,21 +834,21 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
- catch (Newtonsoft.Json.JsonException ex)
+ catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperationsExtensions.cs
index b179ecb7926f9..4de4ae1a3247a 100644
--- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperationsExtensions.cs
+++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperationsExtensions.cs
@@ -1,16 +1,20 @@
+//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
+//
namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans
{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
using System.Threading.Tasks;
- using Microsoft.Rest.Azure;
- using Models;
///
/// Extension methods for CommitmentAssociationsOperations.
@@ -18,7 +22,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans
public static partial class CommitmentAssociationsOperationsExtensions
{
///
- /// Gets a commitment association.
+ /// Get a commitment association.
///
///
/// The operations group for this extension method.
@@ -34,11 +38,11 @@ public static partial class CommitmentAssociationsOperationsExtensions
///
public static CommitmentAssociation Get(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName)
{
- return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentAssociationsOperations)s).GetAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName).GetAwaiter().GetResult();
}
///
- /// Gets a commitment association.
+ /// Get a commitment association.
///
///
/// The operations group for this extension method.
@@ -55,7 +59,7 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o
///
/// The cancellation token.
///
- public static async System.Threading.Tasks.Task GetAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async Task GetAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, null, cancellationToken).ConfigureAwait(false))
{
@@ -78,9 +82,9 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o
///
/// Continuation token for pagination.
///
- public static Microsoft.Rest.Azure.IPage List(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string))
+ public static IPage List(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string))
{
- return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentAssociationsOperations)s).ListAsync(resourceGroupName, commitmentPlanName, skipToken), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ return operations.ListAsync(resourceGroupName, commitmentPlanName, skipToken).GetAwaiter().GetResult();
}
///
@@ -101,7 +105,7 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o
///
/// The cancellation token.
///
- public static async Task> ListAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async Task> ListAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, skipToken, null, cancellationToken).ConfigureAwait(false))
{
@@ -110,7 +114,7 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o
}
///
- /// Re-parents a commitment association from one commitment plan to another.
+ /// Re-parent a commitment association from one commitment plan to another.
///
///
/// The operations group for this extension method.
@@ -124,16 +128,17 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o
///
/// The commitment association name.
///
- ///
- /// The move request payload.
+ ///
+ /// The ARM ID of the commitment plan to re-parent the commitment association
+ /// to.
///
- public static CommitmentAssociation Move(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, MoveCommitmentAssociationRequest movePayload)
+ public static CommitmentAssociation Move(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, string destinationPlanId = default(string))
{
- return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentAssociationsOperations)s).MoveAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, movePayload), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ return operations.MoveAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, destinationPlanId).GetAwaiter().GetResult();
}
///
- /// Re-parents a commitment association from one commitment plan to another.
+ /// Re-parent a commitment association from one commitment plan to another.
///
///
/// The operations group for this extension method.
@@ -147,15 +152,16 @@ public static CommitmentAssociation Move(this ICommitmentAssociationsOperations
///
/// The commitment association name.
///
- ///
- /// The move request payload.
+ ///
+ /// The ARM ID of the commitment plan to re-parent the commitment association
+ /// to.
///
///
/// The cancellation token.
///
- public static async System.Threading.Tasks.Task MoveAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, MoveCommitmentAssociationRequest movePayload, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async Task MoveAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, string destinationPlanId = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.MoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, movePayload, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.MoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, destinationPlanId, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -170,9 +176,9 @@ public static CommitmentAssociation Move(this ICommitmentAssociationsOperations
///
/// The NextLink from the previous successful call to List operation.
///
- public static Microsoft.Rest.Azure.IPage ListNext(this ICommitmentAssociationsOperations operations, string nextPageLink)
+ public static IPage ListNext(this ICommitmentAssociationsOperations operations, string nextPageLink)
{
- return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentAssociationsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -187,7 +193,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IC
///
/// The cancellation token.
///
- public static async Task> ListNextAsync(this ICommitmentAssociationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async Task> ListNextAsync(this ICommitmentAssociationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperations.cs
index 3a1fbcc7de82a..0d72a8a4696ee 100644
--- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperations.cs
+++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperations.cs
@@ -1,22 +1,31 @@
+//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
+//
namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans
{
- using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
///
/// CommitmentPlansOperations operations.
///
- internal partial class CommitmentPlansOperations : Microsoft.Rest.IServiceOperations, ICommitmentPlansOperations
+ internal partial class CommitmentPlansOperations : IServiceOperations, ICommitmentPlansOperations
{
///
/// Initializes a new instance of the CommitmentPlansOperations class.
@@ -29,11 +38,11 @@ internal partial class CommitmentPlansOperations : Microsoft.Rest.IServiceOperat
///
internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- this.Client = client;
+ Client = client;
}
///
@@ -57,81 +66,86 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
/// Thrown when a required parameter is null
///
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (this.Client.SubscriptionId == null)
+ if (Client.SubscriptionId == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (resourceGroupName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (commitmentPlanName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName");
}
- if (this.Client.ApiVersion == null)
+ if (Client.ApiVersion == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
- bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
- System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("commitmentPlanName", commitmentPlanName);
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
- var _baseUrl = this.Client.BaseUri.AbsoluteUri;
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName));
- System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
- if (this.Client.ApiVersion != null)
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
- _url += "?" + string.Join("&", _queryParameters);
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
- System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (this.Client.AcceptLanguage != null)
+ if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
+
+
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -147,51 +161,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (this.Client.Credentials != null)
+ if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (Newtonsoft.Json.JsonException)
+ catch (JsonException)
{
// Ignore the exception
}
- ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -201,7 +215,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -214,27 +228,27 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
- catch (Newtonsoft.Json.JsonException ex)
+ catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
///
- /// Creates a new Azure ML commitment plan resource or updates an existing one.
+ /// Create a new Azure ML commitment plan resource or updates an existing one.
///
///
/// The payload to create or update the Azure ML commitment plan.
@@ -251,90 +265,95 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
/// Thrown when a required parameter is null
///
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (createOrUpdatePayload == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createOrUpdatePayload");
+ throw new ValidationException(ValidationRules.CannotBeNull, "createOrUpdatePayload");
}
if (createOrUpdatePayload != null)
{
createOrUpdatePayload.Validate();
}
- if (this.Client.SubscriptionId == null)
+ if (Client.SubscriptionId == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (resourceGroupName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (commitmentPlanName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName");
}
- if (this.Client.ApiVersion == null)
+ if (Client.ApiVersion == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
- bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
- System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("createOrUpdatePayload", createOrUpdatePayload);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("commitmentPlanName", commitmentPlanName);
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
// Construct URL
- var _baseUrl = this.Client.BaseUri.AbsoluteUri;
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName));
- System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
- if (this.Client.ApiVersion != null)
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
- _url += "?" + string.Join("&", _queryParameters);
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
- System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("PUT");
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (this.Client.AcceptLanguage != null)
+ if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
+
+
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -351,56 +370,56 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
string _requestContent = null;
if(createOrUpdatePayload != null)
{
- _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createOrUpdatePayload, this.Client.SerializationSettings);
- _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(createOrUpdatePayload, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
// Set Credentials
- if (this.Client.Credentials != null)
+ if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 201)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (Newtonsoft.Json.JsonException)
+ catch (JsonException)
{
// Ignore the exception
}
- ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -410,7 +429,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -423,16 +442,16 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
- catch (Newtonsoft.Json.JsonException ex)
+ catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
// Deserialize Response
@@ -441,21 +460,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
- catch (Newtonsoft.Json.JsonException ex)
+ catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
@@ -475,78 +494,83 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
/// Thrown when a required parameter is null
///
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task RemoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async Task RemoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (this.Client.SubscriptionId == null)
+ if (Client.SubscriptionId == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (resourceGroupName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (commitmentPlanName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName");
}
- if (this.Client.ApiVersion == null)
+ if (Client.ApiVersion == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
- bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
- System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("commitmentPlanName", commitmentPlanName);
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Remove", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Remove", tracingParameters);
}
// Construct URL
- var _baseUrl = this.Client.BaseUri.AbsoluteUri;
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName));
- System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
- if (this.Client.ApiVersion != null)
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
- _url += "?" + string.Join("&", _queryParameters);
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
- System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE");
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (this.Client.AcceptLanguage != null)
+ if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
+
+
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -562,43 +586,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (this.Client.Credentials != null)
+ if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- if (_httpResponse.Content != null) {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
}
- else {
- _responseContent = string.Empty;
+ catch (JsonException)
+ {
+ // Ignore the exception
}
- ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -608,7 +640,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -617,7 +649,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
@@ -626,7 +658,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
/// Patch an existing Azure ML commitment plan resource.
///
///
- /// The payload to patch the Azure ML commitment plan with. Only tags and SKU
+ /// The payload to use to patch the Azure ML commitment plan. Only tags and SKU
/// may be modified on an existing commitment plan.
///
///
@@ -641,86 +673,91 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
/// Thrown when a required parameter is null
///
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async Task> PatchWithHttpMessagesAsync(CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (patchPayload == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "patchPayload");
+ throw new ValidationException(ValidationRules.CannotBeNull, "patchPayload");
}
- if (this.Client.SubscriptionId == null)
+ if (Client.SubscriptionId == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (resourceGroupName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (commitmentPlanName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName");
}
- if (this.Client.ApiVersion == null)
+ if (Client.ApiVersion == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
- bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
- System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("patchPayload", patchPayload);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("commitmentPlanName", commitmentPlanName);
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters);
}
// Construct URL
- var _baseUrl = this.Client.BaseUri.AbsoluteUri;
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName));
- System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
- if (this.Client.ApiVersion != null)
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
- _url += "?" + string.Join("&", _queryParameters);
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
- System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH");
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (this.Client.AcceptLanguage != null)
+ if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
+
+
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -737,56 +774,56 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
string _requestContent = null;
if(patchPayload != null)
{
- _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(patchPayload, this.Client.SerializationSettings);
- _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(patchPayload, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
// Set Credentials
- if (this.Client.Credentials != null)
+ if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (Newtonsoft.Json.JsonException)
+ catch (JsonException)
{
// Ignore the exception
}
- ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -796,7 +833,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -809,21 +846,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
- catch (Newtonsoft.Json.JsonException ex)
+ catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
@@ -840,74 +877,79 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
/// Thrown when a required parameter is null
///
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async Task>> ListWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (this.Client.SubscriptionId == null)
+ if (Client.SubscriptionId == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (this.Client.ApiVersion == null)
+ if (Client.ApiVersion == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
- bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
- System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("skipToken", skipToken);
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
// Construct URL
- var _baseUrl = this.Client.BaseUri.AbsoluteUri;
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/commitmentPlans").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
- System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
if (skipToken != null)
{
_queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken)));
}
- if (this.Client.ApiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
- _url += "?" + string.Join("&", _queryParameters);
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
- System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (this.Client.AcceptLanguage != null)
+ if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
+
+
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -923,51 +965,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (this.Client.Credentials != null)
+ if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (Newtonsoft.Json.JsonException)
+ catch (JsonException)
{
// Ignore the exception
}
- ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -977,7 +1019,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -990,21 +1032,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
- catch (Newtonsoft.Json.JsonException ex)
+ catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
@@ -1024,80 +1066,85 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
/// Thrown when a required parameter is null
///
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task>> ListInResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async Task>> ListInResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (this.Client.SubscriptionId == null)
+ if (Client.SubscriptionId == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (resourceGroupName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (this.Client.ApiVersion == null)
+ if (Client.ApiVersion == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
- bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
- System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("skipToken", skipToken);
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListInResourceGroup", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListInResourceGroup", tracingParameters);
}
// Construct URL
- var _baseUrl = this.Client.BaseUri.AbsoluteUri;
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ List _queryParameters = new List();
if (skipToken != null)
{
_queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken)));
}
- if (this.Client.ApiVersion != null)
+ if (Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
- _url += "?" + string.Join("&", _queryParameters);
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
- System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (this.Client.AcceptLanguage != null)
+ if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
+
+
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1113,51 +1160,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (this.Client.Credentials != null)
+ if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (Newtonsoft.Json.JsonException)
+ catch (JsonException)
{
// Ignore the exception
}
- ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1167,7 +1214,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1180,21 +1227,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
- catch (Newtonsoft.Json.JsonException ex)
+ catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
@@ -1211,61 +1258,66 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
/// Thrown when a required parameter is null
///
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink");
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
}
// Tracing
- bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
- System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
_url = _url.Replace("{nextLink}", nextPageLink);
- System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ List _queryParameters = new List();
if (_queryParameters.Count > 0)
{
- _url += "?" + string.Join("&", _queryParameters);
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
- System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (this.Client.AcceptLanguage != null)
+ if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
+
+
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1281,51 +1333,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (this.Client.Credentials != null)
+ if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (Newtonsoft.Json.JsonException)
+ catch (JsonException)
{
// Ignore the exception
}
- ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1335,7 +1387,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1348,21 +1400,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
- catch (Newtonsoft.Json.JsonException ex)
+ catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
@@ -1379,61 +1431,66 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
/// Thrown when a required parameter is null
///
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task>> ListInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async Task>> ListInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink");
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
}
// Tracing
- bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
- System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListInResourceGroupNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListInResourceGroupNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
_url = _url.Replace("{nextLink}", nextPageLink);
- System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ List _queryParameters = new List();
if (_queryParameters.Count > 0)
{
- _url += "?" + string.Join("&", _queryParameters);
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
- System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (this.Client.AcceptLanguage != null)
+ if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
+
+
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1449,51 +1506,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (this.Client.Credentials != null)
+ if (Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
+ ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (Newtonsoft.Json.JsonException)
+ catch (JsonException)
{
// Ignore the exception
}
- ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1503,7 +1560,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1516,21 +1573,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
- catch (Newtonsoft.Json.JsonException ex)
+ catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperationsExtensions.cs
index 2b6416b5e2765..efaa27437d725 100644
--- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperationsExtensions.cs
+++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperationsExtensions.cs
@@ -1,16 +1,20 @@
+//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
+//
namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans
{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
using System.Threading.Tasks;
- using Microsoft.Rest.Azure;
- using Models;
///
/// Extension methods for CommitmentPlansOperations.
@@ -32,7 +36,7 @@ public static partial class CommitmentPlansOperationsExtensions
///
public static CommitmentPlan Get(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName)
{
- return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).GetAsync(resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, commitmentPlanName).GetAwaiter().GetResult();
}
///
@@ -51,7 +55,7 @@ public static CommitmentPlan Get(this ICommitmentPlansOperations operations, str
///
/// The cancellation token.
///
- public static async System.Threading.Tasks.Task GetAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async Task GetAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false))
{
@@ -60,7 +64,7 @@ public static CommitmentPlan Get(this ICommitmentPlansOperations operations, str
}
///
- /// Creates a new Azure ML commitment plan resource or updates an existing one.
+ /// Create a new Azure ML commitment plan resource or updates an existing one.
///
///
/// The operations group for this extension method.
@@ -76,11 +80,11 @@ public static CommitmentPlan Get(this ICommitmentPlansOperations operations, str
///
public static CommitmentPlan CreateOrUpdate(this ICommitmentPlansOperations operations, CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName)
{
- return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).CreateOrUpdateAsync(createOrUpdatePayload, resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ return operations.CreateOrUpdateAsync(createOrUpdatePayload, resourceGroupName, commitmentPlanName).GetAwaiter().GetResult();
}
///
- /// Creates a new Azure ML commitment plan resource or updates an existing one.
+ /// Create a new Azure ML commitment plan resource or updates an existing one.
///
///
/// The operations group for this extension method.
@@ -97,7 +101,7 @@ public static CommitmentPlan CreateOrUpdate(this ICommitmentPlansOperations oper
///
/// The cancellation token.
///
- public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ICommitmentPlansOperations operations, CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async Task CreateOrUpdateAsync(this ICommitmentPlansOperations operations, CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(createOrUpdatePayload, resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false))
{
@@ -119,7 +123,7 @@ public static CommitmentPlan CreateOrUpdate(this ICommitmentPlansOperations oper
///
public static void Remove(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName)
{
- System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).RemoveAsync(resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ operations.RemoveAsync(resourceGroupName, commitmentPlanName).GetAwaiter().GetResult();
}
///
@@ -137,9 +141,9 @@ public static void Remove(this ICommitmentPlansOperations operations, string res
///
/// The cancellation token.
///
- public static async System.Threading.Tasks.Task RemoveAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async Task RemoveAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken))
{
- await operations.RemoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false);
+ (await operations.RemoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
@@ -149,7 +153,7 @@ public static void Remove(this ICommitmentPlansOperations operations, string res
/// The operations group for this extension method.
///
///
- /// The payload to patch the Azure ML commitment plan with. Only tags and SKU
+ /// The payload to use to patch the Azure ML commitment plan. Only tags and SKU
/// may be modified on an existing commitment plan.
///
///
@@ -160,7 +164,7 @@ public static void Remove(this ICommitmentPlansOperations operations, string res
///
public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName)
{
- return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).PatchAsync(patchPayload, resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ return operations.PatchAsync(patchPayload, resourceGroupName, commitmentPlanName).GetAwaiter().GetResult();
}
///
@@ -170,7 +174,7 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C
/// The operations group for this extension method.
///
///
- /// The payload to patch the Azure ML commitment plan with. Only tags and SKU
+ /// The payload to use to patch the Azure ML commitment plan. Only tags and SKU
/// may be modified on an existing commitment plan.
///
///
@@ -182,7 +186,7 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C
///
/// The cancellation token.
///
- public static async System.Threading.Tasks.Task PatchAsync(this ICommitmentPlansOperations operations, CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async Task PatchAsync(this ICommitmentPlansOperations operations, CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.PatchWithHttpMessagesAsync(patchPayload, resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false))
{
@@ -199,9 +203,9 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C
///
/// Continuation token for pagination.
///
- public static Microsoft.Rest.Azure.IPage List(this ICommitmentPlansOperations operations, string skipToken = default(string))
+ public static IPage List(this ICommitmentPlansOperations operations, string skipToken = default(string))
{
- return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListAsync(skipToken), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ return operations.ListAsync(skipToken).GetAwaiter().GetResult();
}
///
@@ -216,7 +220,7 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C
///
/// The cancellation token.
///
- public static async Task> ListAsync(this ICommitmentPlansOperations operations, string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async Task> ListAsync(this ICommitmentPlansOperations operations, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListWithHttpMessagesAsync(skipToken, null, cancellationToken).ConfigureAwait(false))
{
@@ -236,9 +240,9 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C
///
/// Continuation token for pagination.
///
- public static Microsoft.Rest.Azure.IPage ListInResourceGroup(this ICommitmentPlansOperations operations, string resourceGroupName, string skipToken = default(string))
+ public static IPage ListInResourceGroup(this ICommitmentPlansOperations operations, string resourceGroupName, string skipToken = default(string))
{
- return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListInResourceGroupAsync(resourceGroupName, skipToken), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ return operations.ListInResourceGroupAsync(resourceGroupName, skipToken).GetAwaiter().GetResult();
}
///
@@ -256,7 +260,7 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C
///
/// The cancellation token.
///
- public static async Task> ListInResourceGroupAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async Task> ListInResourceGroupAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListInResourceGroupWithHttpMessagesAsync(resourceGroupName, skipToken, null, cancellationToken).ConfigureAwait(false))
{
@@ -273,9 +277,9 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C
///
/// The NextLink from the previous successful call to List operation.
///
- public static Microsoft.Rest.Azure.IPage ListNext(this ICommitmentPlansOperations operations, string nextPageLink)
+ public static IPage ListNext(this ICommitmentPlansOperations operations, string nextPageLink)
{
- return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -290,7 +294,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ICommitme
///
/// The cancellation token.
///
- public static async Task> ListNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async Task> ListNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
@@ -307,9 +311,9 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ICommitme
///
/// The NextLink from the previous successful call to List operation.
///
- public static Microsoft.Rest.Azure.IPage ListInResourceGroupNext(this ICommitmentPlansOperations operations, string nextPageLink)
+ public static IPage ListInResourceGroupNext(this ICommitmentPlansOperations operations, string nextPageLink)
{
- return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListInResourceGroupNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
+ return operations.ListInResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -324,7 +328,7 @@ public static Microsoft.Rest.Azure.IPage ListInResourceGroupNext
///
/// The cancellation token.
///
- public static async Task> ListInResourceGroupNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async Task> ListInResourceGroupNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListInResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IAzureMLCommitmentPlansManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IAzureMLCommitmentPlansManagementClient.cs
index aadd13efaa2ea..72a5b494e1bda 100644
--- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IAzureMLCommitmentPlansManagementClient.cs
+++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IAzureMLCommitmentPlansManagementClient.cs
@@ -1,16 +1,19 @@
+//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
+//
namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
+ using Newtonsoft.Json;
///
/// These APIs allow end users to operate on Azure Machine Learning
@@ -30,17 +33,17 @@ public partial interface IAzureMLCommitmentPlansManagementClient : System.IDispo
///
/// Gets or sets json serialization settings.
///
- Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; }
+ JsonSerializerSettings SerializationSettings { get; }
///
/// Gets or sets json deserialization settings.
///
- Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; }
+ JsonSerializerSettings DeserializationSettings { get; }
///
/// Credentials needed for the client to connect to Azure.
///
- Microsoft.Rest.ServiceClientCredentials Credentials { get; }
+ ServiceClientCredentials Credentials { get; }
///
/// Azure Subscription ID.
@@ -54,23 +57,34 @@ public partial interface IAzureMLCommitmentPlansManagementClient : System.IDispo
string ApiVersion { get; }
///
- /// Gets or sets the preferred language for the response.
+ /// The preferred language for the response.
///
string AcceptLanguage { get; set; }
///
- /// Gets or sets the retry timeout in seconds for Long Running
- /// Operations. Default value is 30.
+ /// The retry timeout in seconds for Long Running Operations. Default
+ /// value is 30.
///
int? LongRunningOperationRetryTimeout { get; set; }
///
- /// When set to true a unique x-ms-client-request-id value is
- /// generated and included in each request. Default is true.
+ /// Whether a unique x-ms-client-request-id should be generated. When
+ /// set to true a unique x-ms-client-request-id value is generated and
+ /// included in each request. Default is true.
///
bool? GenerateClientRequestId { get; set; }
+ ///
+ /// Gets the IOperations.
+ ///
+ IOperations Operations { get; }
+
+ ///
+ /// Gets the ISkusOperations.
+ ///
+ ISkusOperations Skus { get; }
+
///
/// Gets the ICommitmentAssociationsOperations.
///
diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentAssociationsOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentAssociationsOperations.cs
index e0adc9674072a..c63328bccda6c 100644
--- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentAssociationsOperations.cs
+++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentAssociationsOperations.cs
@@ -1,15 +1,22 @@
+//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
+//
namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans
{
+ using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
///
/// CommitmentAssociationsOperations operations.
@@ -17,7 +24,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans
public partial interface ICommitmentAssociationsOperations
{
///
- /// Gets a commitment association.
+ /// Get a commitment association.
///
///
/// The resource group name.
@@ -43,7 +50,7 @@ public partial interface ICommitmentAssociationsOperations
///
/// Thrown when a required parameter is null
///
- System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Get all commitment associations for a parent commitment plan.
///
@@ -71,9 +78,9 @@ public partial interface ICommitmentAssociationsOperations
///
/// Thrown when a required parameter is null
///
- System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Re-parents a commitment association from one commitment plan to
+ /// Re-parent a commitment association from one commitment plan to
/// another.
///
///
@@ -85,8 +92,9 @@ public partial interface ICommitmentAssociationsOperations
///
/// The commitment association name.
///
- ///
- /// The move request payload.
+ ///
+ /// The ARM ID of the commitment plan to re-parent the commitment
+ /// association to.
///
///
/// The headers that will be added to request.
@@ -103,7 +111,7 @@ public partial interface ICommitmentAssociationsOperations
///
/// Thrown when a required parameter is null
///
- System.Threading.Tasks.Task> MoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, MoveCommitmentAssociationRequest movePayload, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ Task> MoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, string destinationPlanId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Get all commitment associations for a parent commitment plan.
///
@@ -125,6 +133,6 @@ public partial interface ICommitmentAssociationsOperations
///
/// Thrown when a required parameter is null
///
- System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentPlansOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentPlansOperations.cs
index 94ec75d951cf2..846202f2fd558 100644
--- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentPlansOperations.cs
+++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentPlansOperations.cs
@@ -1,15 +1,22 @@
+//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
+//
namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans
{
+ using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
///
/// CommitmentPlansOperations operations.
@@ -41,9 +48,9 @@ public partial interface ICommitmentPlansOperations
///
/// Thrown when a required parameter is null
///
- System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Creates a new Azure ML commitment plan resource or updates an
+ /// Create a new Azure ML commitment plan resource or updates an
/// existing one.
///
///
@@ -70,7 +77,7 @@ public partial interface ICommitmentPlansOperations
///
/// Thrown when a required parameter is null
///
- System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ Task> CreateOrUpdateWithHttpMessagesAsync(CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Remove an existing Azure ML commitment plan.
///
@@ -92,12 +99,12 @@ public partial interface ICommitmentPlansOperations
///
/// Thrown when a required parameter is null
///
- System.Threading.Tasks.Task RemoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ Task RemoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Patch an existing Azure ML commitment plan resource.
///
///
- /// The payload to patch the Azure ML commitment plan with. Only tags
+ /// The payload to use to patch the Azure ML commitment plan. Only tags
/// and SKU may be modified on an existing commitment plan.
///
///
@@ -121,7 +128,7 @@ public partial interface ICommitmentPlansOperations
///
/// Thrown when a required parameter is null
///
- System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ Task> PatchWithHttpMessagesAsync(CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///