diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/IJobCollectionsOperations.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/IJobCollectionsOperations.cs index 627b869184b5f..568b6a967e078 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/IJobCollectionsOperations.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/IJobCollectionsOperations.cs @@ -1,16 +1,16 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// JobCollectionsOperations operations. @@ -26,6 +26,15 @@ public partial interface IJobCollectionsOperations /// /// 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 + /// Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all job collections under specified resource group. @@ -39,6 +48,15 @@ public partial interface IJobCollectionsOperations /// /// 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 + /// Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a job collection. @@ -55,6 +73,15 @@ public partial interface IJobCollectionsOperations /// /// 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 + /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Provisions a new job collection or updates an existing job @@ -75,6 +102,15 @@ public partial interface IJobCollectionsOperations /// /// 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 + /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, JobCollectionDefinition jobCollection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Patches an existing job collection. @@ -94,6 +130,15 @@ public partial interface IJobCollectionsOperations /// /// 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 + /// Task> PatchWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, JobCollectionDefinition jobCollection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a job collection. @@ -110,9 +155,15 @@ public partial interface IJobCollectionsOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a job collection. + /// Enables all of the jobs in the job collection. /// /// /// The resource group name. @@ -126,9 +177,15 @@ public partial interface IJobCollectionsOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task EnableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Enables all of the jobs in the job collection. + /// Disables all of the jobs in the job collection. /// /// /// The resource group name. @@ -142,9 +199,15 @@ public partial interface IJobCollectionsOperations /// /// The cancellation token. /// - Task EnableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DisableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Enables all of the jobs in the job collection. + /// Deletes a job collection. /// /// /// The resource group name. @@ -158,9 +221,15 @@ public partial interface IJobCollectionsOperations /// /// The cancellation token. /// - Task BeginEnableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Disables all of the jobs in the job collection. + /// Enables all of the jobs in the job collection. /// /// /// The resource group name. @@ -174,7 +243,13 @@ public partial interface IJobCollectionsOperations /// /// The cancellation token. /// - Task DisableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginEnableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Disables all of the jobs in the job collection. /// @@ -190,6 +265,12 @@ public partial interface IJobCollectionsOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task BeginDisableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all job collections under specified subscription. @@ -203,6 +284,15 @@ public partial interface IJobCollectionsOperations /// /// 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 + /// Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all job collections under specified resource group. @@ -216,6 +306,15 @@ public partial interface IJobCollectionsOperations /// /// 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 + /// Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/IJobsOperations.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/IJobsOperations.cs index 4b95c22571b29..8a437e3cf5cd5 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/IJobsOperations.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/IJobsOperations.cs @@ -1,17 +1,17 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Azure.OData; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// JobsOperations operations. @@ -36,6 +36,15 @@ public partial interface IJobsOperations /// /// 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 + /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Provisions a new job or updates an existing job. @@ -58,6 +67,15 @@ public partial interface IJobsOperations /// /// 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 + /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, string jobName, JobDefinition job, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Patches an existing job. @@ -80,6 +98,15 @@ public partial interface IJobsOperations /// /// 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 + /// Task> PatchWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, string jobName, JobDefinition job, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a job. @@ -99,6 +126,12 @@ public partial interface IJobsOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Runs a job. @@ -118,6 +151,12 @@ public partial interface IJobsOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task RunWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all jobs under the specified job collection. @@ -137,6 +176,15 @@ public partial interface IJobsOperations /// /// 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 + /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists job history. @@ -159,6 +207,15 @@ public partial interface IJobsOperations /// /// 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 + /// Task>> ListJobHistoryWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, string jobName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all jobs under the specified job collection. @@ -172,6 +229,15 @@ public partial interface IJobsOperations /// /// 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 + /// Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists job history. @@ -185,6 +251,15 @@ public partial interface IJobsOperations /// /// 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 + /// Task>> ListJobHistoryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/ISchedulerManagementClient.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/ISchedulerManagementClient.cs index f9122e1c689cc..d3a98d9792608 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/ISchedulerManagementClient.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/ISchedulerManagementClient.cs @@ -1,26 +1,22 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - using Newtonsoft.Json; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using Newtonsoft.Json; /// /// - public partial interface ISchedulerManagementClient : IDisposable + public partial interface ISchedulerManagementClient : System.IDisposable { /// /// The base URI of the service. /// - Uri BaseUri { get; set; } + System.Uri BaseUri { get; set; } /// /// Gets or sets json serialization settings. @@ -33,7 +29,7 @@ public partial interface ISchedulerManagementClient : IDisposable JsonSerializerSettings DeserializationSettings { get; } /// - /// Gets Azure subscription credentials. + /// Credentials needed for the client to connect to Azure. /// ServiceClientCredentials Credentials { get; } @@ -48,19 +44,20 @@ public partial interface ISchedulerManagementClient : IDisposable 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; } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobCollectionsOperations.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobCollectionsOperations.cs index 0f811f82dc5da..ffebf84fc7fc4 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobCollectionsOperations.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobCollectionsOperations.cs @@ -1,23 +1,20 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler { - using System; - 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// JobCollectionsOperations operations. @@ -30,13 +27,16 @@ internal partial class JobCollectionsOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal JobCollectionsOperations(SchedulerManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -53,16 +53,28 @@ internal JobCollectionsOperations(SchedulerManagementClient 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 Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -77,36 +89,38 @@ internal JobCollectionsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Scheduler/jobCollections").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Scheduler/jobCollections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -122,10 +136,10 @@ internal JobCollectionsOperations(SchedulerManagementClient 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) @@ -133,7 +147,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -147,7 +161,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -189,7 +203,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -220,12 +234,24 @@ internal JobCollectionsOperations(SchedulerManagementClient 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 Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -233,7 +259,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -249,37 +275,39 @@ internal JobCollectionsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -295,10 +323,10 @@ internal JobCollectionsOperations(SchedulerManagementClient 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) @@ -306,7 +334,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -320,7 +348,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -362,7 +390,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -396,12 +424,24 @@ internal JobCollectionsOperations(SchedulerManagementClient 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 Task> GetWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -413,7 +453,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobCollectionName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -430,38 +470,40 @@ internal JobCollectionsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -477,10 +519,10 @@ internal JobCollectionsOperations(SchedulerManagementClient 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) @@ -488,7 +530,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -502,7 +544,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -544,7 +586,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -581,12 +623,24 @@ internal JobCollectionsOperations(SchedulerManagementClient 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 Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, JobCollectionDefinition jobCollection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -598,7 +652,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobCollectionName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -620,38 +674,40 @@ internal JobCollectionsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -668,15 +724,15 @@ internal JobCollectionsOperations(SchedulerManagementClient client) string _requestContent = null; if(jobCollection != null) { - _requestContent = SafeJsonConvert.SerializeObject(jobCollection, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(jobCollection, 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) @@ -684,7 +740,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -698,7 +754,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -740,7 +796,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -758,7 +814,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -795,12 +851,24 @@ internal JobCollectionsOperations(SchedulerManagementClient 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 Task> PatchWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, JobCollectionDefinition jobCollection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -812,7 +880,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobCollectionName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -834,38 +902,40 @@ internal JobCollectionsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("PATCH"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -882,15 +952,15 @@ internal JobCollectionsOperations(SchedulerManagementClient client) string _requestContent = null; if(jobCollection != null) { - _requestContent = SafeJsonConvert.SerializeObject(jobCollection, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(jobCollection, 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) @@ -898,7 +968,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -912,7 +982,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -954,7 +1024,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -991,9 +1061,52 @@ internal JobCollectionsOperations(SchedulerManagementClient client) public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( - resourceGroupName, jobCollectionName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, jobCollectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Enables all of the jobs in the job collection. + /// + /// + /// The resource group name. + /// + /// + /// The job collection name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task EnableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginEnableWithHttpMessagesAsync(resourceGroupName, jobCollectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Disables all of the jobs in the job collection. + /// + /// + /// The resource group name. + /// + /// + /// The job collection name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DisableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDisableWithHttpMessagesAsync(resourceGroupName, jobCollectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1011,12 +1124,21 @@ internal JobCollectionsOperations(SchedulerManagementClient 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 Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1028,7 +1150,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobCollectionName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -1045,38 +1167,40 @@ internal JobCollectionsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -1092,10 +1216,10 @@ internal JobCollectionsOperations(SchedulerManagementClient 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) @@ -1103,7 +1227,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1114,7 +1238,20 @@ internal JobCollectionsOperations(SchedulerManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + 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; + } + } + catch (JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1147,29 +1284,6 @@ internal JobCollectionsOperations(SchedulerManagementClient client) return _result; } - /// - /// Enables all of the jobs in the job collection. - /// - /// - /// The resource group name. - /// - /// - /// The job collection name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task EnableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginEnableWithHttpMessagesAsync( - resourceGroupName, jobCollectionName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - /// /// Enables all of the jobs in the job collection. /// @@ -1185,12 +1299,21 @@ internal JobCollectionsOperations(SchedulerManagementClient 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 Task BeginEnableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1202,7 +1325,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobCollectionName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -1219,38 +1342,40 @@ internal JobCollectionsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "BeginEnable", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/enable").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/enable").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -1266,10 +1391,10 @@ internal JobCollectionsOperations(SchedulerManagementClient 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) @@ -1277,7 +1402,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1288,7 +1413,20 @@ internal JobCollectionsOperations(SchedulerManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + 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; + } + } + catch (JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1321,29 +1459,6 @@ internal JobCollectionsOperations(SchedulerManagementClient client) return _result; } - /// - /// Disables all of the jobs in the job collection. - /// - /// - /// The resource group name. - /// - /// - /// The job collection name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DisableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDisableWithHttpMessagesAsync( - resourceGroupName, jobCollectionName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - /// /// Disables all of the jobs in the job collection. /// @@ -1359,12 +1474,21 @@ internal JobCollectionsOperations(SchedulerManagementClient 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 Task BeginDisableWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1376,7 +1500,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobCollectionName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -1393,38 +1517,40 @@ internal JobCollectionsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "BeginDisable", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/disable").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/disable").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -1440,10 +1566,10 @@ internal JobCollectionsOperations(SchedulerManagementClient 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) @@ -1451,7 +1577,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1462,7 +1588,20 @@ internal JobCollectionsOperations(SchedulerManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + 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; + } + } + catch (JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1507,6 +1646,18 @@ internal JobCollectionsOperations(SchedulerManagementClient 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. /// @@ -1533,26 +1684,28 @@ internal JobCollectionsOperations(SchedulerManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -1568,10 +1721,10 @@ internal JobCollectionsOperations(SchedulerManagementClient 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) @@ -1579,7 +1732,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1593,7 +1746,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -1635,7 +1788,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1666,6 +1819,18 @@ internal JobCollectionsOperations(SchedulerManagementClient 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. /// @@ -1692,26 +1857,28 @@ internal JobCollectionsOperations(SchedulerManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -1727,10 +1894,10 @@ internal JobCollectionsOperations(SchedulerManagementClient 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) @@ -1738,7 +1905,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1752,7 +1919,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -1794,7 +1961,7 @@ internal JobCollectionsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobCollectionsOperationsExtensions.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobCollectionsOperationsExtensions.cs index 66389bbbc3042..23d386bdfa0ef 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobCollectionsOperationsExtensions.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobCollectionsOperationsExtensions.cs @@ -1,16 +1,14 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Threading; + using System.Threading.Tasks; /// /// Extension methods for JobCollectionsOperations. @@ -25,7 +23,7 @@ public static partial class JobCollectionsOperationsExtensions /// public static IPage ListBySubscription(this IJobCollectionsOperations operations) { - return Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).ListBySubscriptionAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); } /// @@ -56,7 +54,7 @@ public static IPage ListBySubscription(this IJobCollect /// public static IPage ListByResourceGroup(this IJobCollectionsOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).ListByResourceGroupAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); } /// @@ -93,7 +91,7 @@ public static IPage ListByResourceGroup(this IJobCollec /// public static JobCollectionDefinition Get(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName) { - return Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).GetAsync(resourceGroupName, jobCollectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, jobCollectionName).GetAwaiter().GetResult(); } /// @@ -136,7 +134,7 @@ public static JobCollectionDefinition Get(this IJobCollectionsOperations operati /// public static JobCollectionDefinition CreateOrUpdate(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName, JobCollectionDefinition jobCollection) { - return Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).CreateOrUpdateAsync(resourceGroupName, jobCollectionName, jobCollection), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, jobCollectionName, jobCollection).GetAwaiter().GetResult(); } /// @@ -182,7 +180,7 @@ public static JobCollectionDefinition CreateOrUpdate(this IJobCollectionsOperati /// public static JobCollectionDefinition Patch(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName, JobCollectionDefinition jobCollection) { - return Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).PatchAsync(resourceGroupName, jobCollectionName, jobCollection), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.PatchAsync(resourceGroupName, jobCollectionName, jobCollection).GetAwaiter().GetResult(); } /// @@ -225,7 +223,7 @@ public static JobCollectionDefinition Patch(this IJobCollectionsOperations opera /// public static void Delete(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName) { - Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).DeleteAsync(resourceGroupName, jobCollectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, jobCollectionName).GetAwaiter().GetResult(); } /// @@ -245,11 +243,11 @@ public static void Delete(this IJobCollectionsOperations operations, string reso /// public static async Task DeleteAsync(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, jobCollectionName, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, jobCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Deletes a job collection. + /// Enables all of the jobs in the job collection. /// /// /// The operations group for this extension method. @@ -260,13 +258,13 @@ public static void Delete(this IJobCollectionsOperations operations, string reso /// /// The job collection name. /// - public static void BeginDelete(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName) + public static void Enable(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName) { - Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).BeginDeleteAsync(resourceGroupName, jobCollectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.EnableAsync(resourceGroupName, jobCollectionName).GetAwaiter().GetResult(); } /// - /// Deletes a job collection. + /// Enables all of the jobs in the job collection. /// /// /// The operations group for this extension method. @@ -280,13 +278,13 @@ public static void BeginDelete(this IJobCollectionsOperations operations, string /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task EnableAsync(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, jobCollectionName, null, cancellationToken).ConfigureAwait(false); + (await operations.EnableWithHttpMessagesAsync(resourceGroupName, jobCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Enables all of the jobs in the job collection. + /// Disables all of the jobs in the job collection. /// /// /// The operations group for this extension method. @@ -297,13 +295,13 @@ public static void BeginDelete(this IJobCollectionsOperations operations, string /// /// The job collection name. /// - public static void Enable(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName) + public static void Disable(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName) { - Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).EnableAsync(resourceGroupName, jobCollectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.DisableAsync(resourceGroupName, jobCollectionName).GetAwaiter().GetResult(); } /// - /// Enables all of the jobs in the job collection. + /// Disables all of the jobs in the job collection. /// /// /// The operations group for this extension method. @@ -317,13 +315,13 @@ public static void Enable(this IJobCollectionsOperations operations, string reso /// /// The cancellation token. /// - public static async Task EnableAsync(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DisableAsync(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.EnableWithHttpMessagesAsync(resourceGroupName, jobCollectionName, null, cancellationToken).ConfigureAwait(false); + (await operations.DisableWithHttpMessagesAsync(resourceGroupName, jobCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Enables all of the jobs in the job collection. + /// Deletes a job collection. /// /// /// The operations group for this extension method. @@ -334,13 +332,13 @@ public static void Enable(this IJobCollectionsOperations operations, string reso /// /// The job collection name. /// - public static void BeginEnable(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName) + public static void BeginDelete(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName) { - Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).BeginEnableAsync(resourceGroupName, jobCollectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.BeginDeleteAsync(resourceGroupName, jobCollectionName).GetAwaiter().GetResult(); } /// - /// Enables all of the jobs in the job collection. + /// Deletes a job collection. /// /// /// The operations group for this extension method. @@ -354,13 +352,13 @@ public static void BeginEnable(this IJobCollectionsOperations operations, string /// /// The cancellation token. /// - public static async Task BeginEnableAsync(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginEnableWithHttpMessagesAsync(resourceGroupName, jobCollectionName, null, cancellationToken).ConfigureAwait(false); + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, jobCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Disables all of the jobs in the job collection. + /// Enables all of the jobs in the job collection. /// /// /// The operations group for this extension method. @@ -371,13 +369,13 @@ public static void BeginEnable(this IJobCollectionsOperations operations, string /// /// The job collection name. /// - public static void Disable(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName) + public static void BeginEnable(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName) { - Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).DisableAsync(resourceGroupName, jobCollectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.BeginEnableAsync(resourceGroupName, jobCollectionName).GetAwaiter().GetResult(); } /// - /// Disables all of the jobs in the job collection. + /// Enables all of the jobs in the job collection. /// /// /// The operations group for this extension method. @@ -391,9 +389,9 @@ public static void Disable(this IJobCollectionsOperations operations, string res /// /// The cancellation token. /// - public static async Task DisableAsync(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginEnableAsync(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DisableWithHttpMessagesAsync(resourceGroupName, jobCollectionName, null, cancellationToken).ConfigureAwait(false); + (await operations.BeginEnableWithHttpMessagesAsync(resourceGroupName, jobCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -410,7 +408,7 @@ public static void Disable(this IJobCollectionsOperations operations, string res /// public static void BeginDisable(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName) { - Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).BeginDisableAsync(resourceGroupName, jobCollectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.BeginDisableAsync(resourceGroupName, jobCollectionName).GetAwaiter().GetResult(); } /// @@ -430,7 +428,7 @@ public static void BeginDisable(this IJobCollectionsOperations operations, strin /// public static async Task BeginDisableAsync(this IJobCollectionsOperations operations, string resourceGroupName, string jobCollectionName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDisableWithHttpMessagesAsync(resourceGroupName, jobCollectionName, null, cancellationToken).ConfigureAwait(false); + (await operations.BeginDisableWithHttpMessagesAsync(resourceGroupName, jobCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -444,7 +442,7 @@ public static void BeginDisable(this IJobCollectionsOperations operations, strin /// public static IPage ListBySubscriptionNext(this IJobCollectionsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).ListBySubscriptionNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -478,7 +476,7 @@ public static IPage ListBySubscriptionNext(this IJobCol /// public static IPage ListByResourceGroupNext(this IJobCollectionsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IJobCollectionsOperations)s).ListByResourceGroupNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobsOperations.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobsOperations.cs index 6874c7503655f..ae25d4be5dc30 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobsOperations.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobsOperations.cs @@ -1,24 +1,21 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler { - using System; - using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; using System.Collections.Generic; + using System.Linq; using System.Net; using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure.OData; - using Microsoft.Rest.Azure; - using Models; /// /// JobsOperations operations. @@ -31,13 +28,16 @@ internal partial class JobsOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal JobsOperations(SchedulerManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -63,12 +63,24 @@ internal JobsOperations(SchedulerManagementClient 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 Task> GetWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -84,7 +96,7 @@ internal JobsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -102,39 +114,41 @@ internal JobsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); - _url = _url.Replace("{jobName}", Uri.EscapeDataString(jobName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -150,10 +164,10 @@ internal JobsOperations(SchedulerManagementClient 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) @@ -161,7 +175,7 @@ internal JobsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -175,7 +189,7 @@ internal JobsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -217,7 +231,7 @@ internal JobsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -257,12 +271,24 @@ internal JobsOperations(SchedulerManagementClient 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 Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, string jobName, JobDefinition job, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -278,7 +304,7 @@ internal JobsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -301,39 +327,41 @@ internal JobsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); - _url = _url.Replace("{jobName}", Uri.EscapeDataString(jobName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -350,15 +378,15 @@ internal JobsOperations(SchedulerManagementClient client) string _requestContent = null; if(job != null) { - _requestContent = SafeJsonConvert.SerializeObject(job, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(job, 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) @@ -366,7 +394,7 @@ internal JobsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -380,7 +408,7 @@ internal JobsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -422,7 +450,7 @@ internal JobsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -440,7 +468,7 @@ internal JobsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -480,12 +508,24 @@ internal JobsOperations(SchedulerManagementClient 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 Task> PatchWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, string jobName, JobDefinition job, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -501,7 +541,7 @@ internal JobsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -524,39 +564,41 @@ internal JobsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); - _url = _url.Replace("{jobName}", Uri.EscapeDataString(jobName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("PATCH"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -573,15 +615,15 @@ internal JobsOperations(SchedulerManagementClient client) string _requestContent = null; if(job != null) { - _requestContent = SafeJsonConvert.SerializeObject(job, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(job, 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) @@ -589,7 +631,7 @@ internal JobsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -603,7 +645,7 @@ internal JobsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -645,7 +687,7 @@ internal JobsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -682,12 +724,21 @@ internal JobsOperations(SchedulerManagementClient 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 Task DeleteWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -703,7 +754,7 @@ internal JobsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -721,39 +772,41 @@ internal JobsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); - _url = _url.Replace("{jobName}", Uri.EscapeDataString(jobName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -769,10 +822,10 @@ internal JobsOperations(SchedulerManagementClient 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) @@ -780,7 +833,7 @@ internal JobsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -791,7 +844,20 @@ internal JobsOperations(SchedulerManagementClient client) if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + 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; + } + } + catch (JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -842,12 +908,21 @@ internal JobsOperations(SchedulerManagementClient 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 Task RunWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -863,7 +938,7 @@ internal JobsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -881,39 +956,41 @@ internal JobsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "Run", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/run").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); - _url = _url.Replace("{jobName}", Uri.EscapeDataString(jobName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/run").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -929,10 +1006,10 @@ internal JobsOperations(SchedulerManagementClient 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) @@ -940,7 +1017,7 @@ internal JobsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -951,7 +1028,20 @@ internal JobsOperations(SchedulerManagementClient client) if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + 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; + } + } + catch (JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1002,12 +1092,24 @@ internal JobsOperations(SchedulerManagementClient 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 Task>> ListWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1019,7 +1121,7 @@ internal JobsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobCollectionName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -1037,46 +1139,48 @@ internal JobsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); List _queryParameters = new List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString().Replace("'", string.Empty); - if (!string.IsNullOrEmpty(_odataFilter)) + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) { _queryParameters.Add(_odataFilter); } } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -1092,10 +1196,10 @@ internal JobsOperations(SchedulerManagementClient 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) @@ -1103,7 +1207,7 @@ internal JobsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1117,7 +1221,7 @@ internal JobsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -1159,7 +1263,7 @@ internal JobsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1199,12 +1303,24 @@ internal JobsOperations(SchedulerManagementClient 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 Task>> ListJobHistoryWithHttpMessagesAsync(string resourceGroupName, string jobCollectionName, string jobName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1220,7 +1336,7 @@ internal JobsOperations(SchedulerManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } @@ -1239,47 +1355,49 @@ internal JobsOperations(SchedulerManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "ListJobHistory", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/history").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{jobCollectionName}", Uri.EscapeDataString(jobCollectionName)); - _url = _url.Replace("{jobName}", Uri.EscapeDataString(jobName)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/history").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobCollectionName}", System.Uri.EscapeDataString(jobCollectionName)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString().Replace("'", string.Empty); - if (!string.IsNullOrEmpty(_odataFilter)) + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) { _queryParameters.Add(_odataFilter); } } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", 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 - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -1295,10 +1413,10 @@ internal JobsOperations(SchedulerManagementClient 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) @@ -1306,7 +1424,7 @@ internal JobsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1320,7 +1438,7 @@ internal JobsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -1362,7 +1480,7 @@ internal JobsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1393,6 +1511,18 @@ internal JobsOperations(SchedulerManagementClient 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. /// @@ -1419,26 +1549,28 @@ internal JobsOperations(SchedulerManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -1454,10 +1586,10 @@ internal JobsOperations(SchedulerManagementClient 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) @@ -1465,7 +1597,7 @@ internal JobsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1479,7 +1611,7 @@ internal JobsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -1521,7 +1653,7 @@ internal JobsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1552,6 +1684,18 @@ internal JobsOperations(SchedulerManagementClient 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. /// @@ -1578,26 +1722,28 @@ internal JobsOperations(SchedulerManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); + var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + _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", Guid.NewGuid().ToString()); + _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) @@ -1613,10 +1759,10 @@ internal JobsOperations(SchedulerManagementClient 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) @@ -1624,7 +1770,7 @@ internal JobsOperations(SchedulerManagementClient client) 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) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1638,7 +1784,7 @@ internal JobsOperations(SchedulerManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); @@ -1680,7 +1826,7 @@ internal JobsOperations(SchedulerManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobsOperationsExtensions.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobsOperationsExtensions.cs index 2ae2f458d6b78..cdb737954ad49 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobsOperationsExtensions.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/JobsOperationsExtensions.cs @@ -1,17 +1,15 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Azure.OData; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; + using System.Threading; + using System.Threading.Tasks; /// /// Extension methods for JobsOperations. @@ -35,7 +33,7 @@ public static partial class JobsOperationsExtensions /// public static JobDefinition Get(this IJobsOperations operations, string resourceGroupName, string jobCollectionName, string jobName) { - return Task.Factory.StartNew(s => ((IJobsOperations)s).GetAsync(resourceGroupName, jobCollectionName, jobName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, jobCollectionName, jobName).GetAwaiter().GetResult(); } /// @@ -84,7 +82,7 @@ public static JobDefinition Get(this IJobsOperations operations, string resource /// public static JobDefinition CreateOrUpdate(this IJobsOperations operations, string resourceGroupName, string jobCollectionName, string jobName, JobDefinition job) { - return Task.Factory.StartNew(s => ((IJobsOperations)s).CreateOrUpdateAsync(resourceGroupName, jobCollectionName, jobName, job), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, jobCollectionName, jobName, job).GetAwaiter().GetResult(); } /// @@ -136,7 +134,7 @@ public static JobDefinition CreateOrUpdate(this IJobsOperations operations, stri /// public static JobDefinition Patch(this IJobsOperations operations, string resourceGroupName, string jobCollectionName, string jobName, JobDefinition job) { - return Task.Factory.StartNew(s => ((IJobsOperations)s).PatchAsync(resourceGroupName, jobCollectionName, jobName, job), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.PatchAsync(resourceGroupName, jobCollectionName, jobName, job).GetAwaiter().GetResult(); } /// @@ -185,7 +183,7 @@ public static JobDefinition Patch(this IJobsOperations operations, string resour /// public static void Delete(this IJobsOperations operations, string resourceGroupName, string jobCollectionName, string jobName) { - Task.Factory.StartNew(s => ((IJobsOperations)s).DeleteAsync(resourceGroupName, jobCollectionName, jobName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, jobCollectionName, jobName).GetAwaiter().GetResult(); } /// @@ -208,7 +206,7 @@ public static void Delete(this IJobsOperations operations, string resourceGroupN /// public static async Task DeleteAsync(this IJobsOperations operations, string resourceGroupName, string jobCollectionName, string jobName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, jobCollectionName, jobName, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, jobCollectionName, jobName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -228,7 +226,7 @@ public static void Delete(this IJobsOperations operations, string resourceGroupN /// public static void Run(this IJobsOperations operations, string resourceGroupName, string jobCollectionName, string jobName) { - Task.Factory.StartNew(s => ((IJobsOperations)s).RunAsync(resourceGroupName, jobCollectionName, jobName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.RunAsync(resourceGroupName, jobCollectionName, jobName).GetAwaiter().GetResult(); } /// @@ -251,7 +249,7 @@ public static void Run(this IJobsOperations operations, string resourceGroupName /// public static async Task RunAsync(this IJobsOperations operations, string resourceGroupName, string jobCollectionName, string jobName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.RunWithHttpMessagesAsync(resourceGroupName, jobCollectionName, jobName, null, cancellationToken).ConfigureAwait(false); + (await operations.RunWithHttpMessagesAsync(resourceGroupName, jobCollectionName, jobName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -271,7 +269,7 @@ public static void Run(this IJobsOperations operations, string resourceGroupName /// public static IPage List(this IJobsOperations operations, string resourceGroupName, string jobCollectionName, ODataQuery odataQuery = default(ODataQuery)) { - return Task.Factory.StartNew(s => ((IJobsOperations)s).ListAsync(resourceGroupName, jobCollectionName, odataQuery), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, jobCollectionName, odataQuery).GetAwaiter().GetResult(); } /// @@ -320,7 +318,7 @@ public static void Run(this IJobsOperations operations, string resourceGroupName /// public static IPage ListJobHistory(this IJobsOperations operations, string resourceGroupName, string jobCollectionName, string jobName, ODataQuery odataQuery = default(ODataQuery)) { - return Task.Factory.StartNew(s => ((IJobsOperations)s).ListJobHistoryAsync(resourceGroupName, jobCollectionName, jobName, odataQuery), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListJobHistoryAsync(resourceGroupName, jobCollectionName, jobName, odataQuery).GetAwaiter().GetResult(); } /// @@ -363,7 +361,7 @@ public static void Run(this IJobsOperations operations, string resourceGroupName /// public static IPage ListNext(this IJobsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IJobsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -397,7 +395,7 @@ public static IPage ListNext(this IJobsOperations operations, str /// public static IPage ListJobHistoryNext(this IJobsOperations operations, string nextPageLink) { - return Task.Factory.StartNew(s => ((IJobsOperations)s).ListJobHistoryNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListJobHistoryNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/BasicAuthentication.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/BasicAuthentication.cs index eba95b43800b6..3f243413715bc 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/BasicAuthentication.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/BasicAuthentication.cs @@ -1,33 +1,41 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; + [Newtonsoft.Json.JsonObject("Basic")] public partial class BasicAuthentication : HttpAuthentication { /// /// Initializes a new instance of the BasicAuthentication class. /// - public BasicAuthentication() { } + public BasicAuthentication() + { + CustomInit(); + } /// /// Initializes a new instance of the BasicAuthentication class. /// - public BasicAuthentication(HttpAuthenticationType? type = default(HttpAuthenticationType?), string username = default(string), string password = default(string)) - : base(type) + /// Gets or sets the username. + /// Gets or sets the password, return value will + /// always be empty. + public BasicAuthentication(string username = default(string), string password = default(string)) { Username = username; Password = password; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the username. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ClientCertAuthentication.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ClientCertAuthentication.cs index d3be8c9df85b3..e52b3deccc7db 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ClientCertAuthentication.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ClientCertAuthentication.cs @@ -1,36 +1,52 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; + [Newtonsoft.Json.JsonObject("ClientCertificate")] public partial class ClientCertAuthentication : HttpAuthentication { /// /// Initializes a new instance of the ClientCertAuthentication class. /// - public ClientCertAuthentication() { } + public ClientCertAuthentication() + { + CustomInit(); + } /// /// Initializes a new instance of the ClientCertAuthentication class. /// - public ClientCertAuthentication(HttpAuthenticationType? type = default(HttpAuthenticationType?), string password = default(string), string pfx = default(string), string certificateThumbprint = default(string), DateTime? certificateExpirationDate = default(DateTime?), string certificateSubjectName = default(string)) - : base(type) + /// Gets or sets the certificate password, + /// return value will always be empty. + /// Gets or sets the pfx certificate. Accepts + /// certification in base64 encoding, return value will always be + /// empty. + /// Gets or sets the certificate + /// thumbprint. + /// Gets or sets the + /// certificate expiration date. + /// Gets or sets the certificate + /// subject name. + public ClientCertAuthentication(string password = default(string), string pfx = default(string), string certificateThumbprint = default(string), System.DateTime? certificateExpirationDate = default(System.DateTime?), string certificateSubjectName = default(string)) { Password = password; Pfx = pfx; CertificateThumbprint = certificateThumbprint; CertificateExpirationDate = certificateExpirationDate; CertificateSubjectName = certificateSubjectName; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the certificate password, return value will always be /// empty. @@ -55,7 +71,7 @@ public ClientCertAuthentication() { } /// Gets or sets the certificate expiration date. /// [JsonProperty(PropertyName = "certificateExpirationDate")] - public DateTime? CertificateExpirationDate { get; set; } + public System.DateTime? CertificateExpirationDate { get; set; } /// /// Gets or sets the certificate subject name. diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/DayOfWeek.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/DayOfWeek.cs index c3c7de395e9f6..019bfb7d0af12 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/DayOfWeek.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/DayOfWeek.cs @@ -1,10 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using System.Runtime; using System.Runtime.Serialization; /// @@ -28,4 +30,55 @@ public enum DayOfWeek [EnumMember(Value = "Saturday")] Saturday } + internal static class DayOfWeekEnumExtension + { + internal static string ToSerializedValue(this DayOfWeek? value) + { + return value == null ? null : ((DayOfWeek)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DayOfWeek value) + { + switch( value ) + { + case DayOfWeek.Sunday: + return "Sunday"; + case DayOfWeek.Monday: + return "Monday"; + case DayOfWeek.Tuesday: + return "Tuesday"; + case DayOfWeek.Wednesday: + return "Wednesday"; + case DayOfWeek.Thursday: + return "Thursday"; + case DayOfWeek.Friday: + return "Friday"; + case DayOfWeek.Saturday: + return "Saturday"; + } + return null; + } + + internal static DayOfWeek? ParseDayOfWeek(this string value) + { + switch( value ) + { + case "Sunday": + return DayOfWeek.Sunday; + case "Monday": + return DayOfWeek.Monday; + case "Tuesday": + return DayOfWeek.Tuesday; + case "Wednesday": + return DayOfWeek.Wednesday; + case "Thursday": + return DayOfWeek.Thursday; + case "Friday": + return DayOfWeek.Friday; + case "Saturday": + return DayOfWeek.Saturday; + } + return null; + } + } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/HttpAuthentication.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/HttpAuthentication.cs index d1f7776a2ce03..489e1857a41aa 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/HttpAuthentication.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/HttpAuthentication.cs @@ -1,38 +1,26 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; using System.Linq; - using System.Collections.Generic; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; public partial class HttpAuthentication { /// /// Initializes a new instance of the HttpAuthentication class. /// - public HttpAuthentication() { } - - /// - /// Initializes a new instance of the HttpAuthentication class. - /// - public HttpAuthentication(HttpAuthenticationType? type = default(HttpAuthenticationType?)) + public HttpAuthentication() { - Type = type; + CustomInit(); } + /// - /// Gets or sets the HTTP authentication type. Possible values - /// include: 'NotSpecified', 'ClientCertificate', - /// 'ActiveDirectoryOAuth', 'Basic' + /// An initialization method that performs custom operations like setting defaults /// - [JsonProperty(PropertyName = "type")] - public HttpAuthenticationType? Type { get; set; } + partial void CustomInit(); } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/HttpAuthenticationType.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/HttpAuthenticationType.cs deleted file mode 100644 index 9ec55807b2baf..0000000000000 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/HttpAuthenticationType.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -namespace Microsoft.Azure.Management.Scheduler.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; - - /// - /// Defines values for HttpAuthenticationType. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum HttpAuthenticationType - { - [EnumMember(Value = "NotSpecified")] - NotSpecified, - [EnumMember(Value = "ClientCertificate")] - ClientCertificate, - [EnumMember(Value = "ActiveDirectoryOAuth")] - ActiveDirectoryOAuth, - [EnumMember(Value = "Basic")] - Basic - } -} diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/HttpRequest.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/HttpRequest.cs index 2acf2897bc37c..8e496ed175c35 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/HttpRequest.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/HttpRequest.cs @@ -1,26 +1,34 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; public partial class HttpRequest { /// /// Initializes a new instance of the HttpRequest class. /// - public HttpRequest() { } + public HttpRequest() + { + CustomInit(); + } /// /// Initializes a new instance of the HttpRequest class. /// + /// Gets or sets the authentication method + /// of the request. + /// Gets or sets the URI of the request. + /// Gets or sets the method of the + /// request. + /// Gets or sets the request body. + /// Gets or sets the headers. public HttpRequest(HttpAuthentication authentication = default(HttpAuthentication), string uri = default(string), string method = default(string), string body = default(string), IDictionary headers = default(IDictionary)) { Authentication = authentication; @@ -28,8 +36,14 @@ public HttpRequest() { } Method = method; Body = body; Headers = headers; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the authentication method of the request. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobAction.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobAction.cs index 46ee7c0886bc1..fbfeb59609e9b 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobAction.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobAction.cs @@ -1,26 +1,37 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobAction { /// /// Initializes a new instance of the JobAction class. /// - public JobAction() { } + public JobAction() + { + CustomInit(); + } /// /// Initializes a new instance of the JobAction class. /// + /// Gets or sets the job action type. Possible + /// values include: 'Http', 'Https', 'StorageQueue', 'ServiceBusQueue', + /// 'ServiceBusTopic' + /// Gets or sets the http requests. + /// Gets or sets the storage queue + /// message. + /// Gets or sets the service bus + /// queue message. + /// Gets or sets the service bus + /// topic message. + /// Gets or sets the retry policy. + /// Gets or sets the error action. public JobAction(JobActionType? type = default(JobActionType?), HttpRequest request = default(HttpRequest), StorageQueueMessage queueMessage = default(StorageQueueMessage), ServiceBusQueueMessage serviceBusQueueMessage = default(ServiceBusQueueMessage), ServiceBusTopicMessage serviceBusTopicMessage = default(ServiceBusTopicMessage), RetryPolicy retryPolicy = default(RetryPolicy), JobErrorAction errorAction = default(JobErrorAction)) { Type = type; @@ -30,8 +41,14 @@ public JobAction() { } ServiceBusTopicMessage = serviceBusTopicMessage; RetryPolicy = retryPolicy; ErrorAction = errorAction; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the job action type. Possible values include: 'Http', /// 'Https', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic' diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobActionType.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobActionType.cs index 74d87b06603d7..6e525d124d175 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobActionType.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobActionType.cs @@ -1,10 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using System.Runtime; using System.Runtime.Serialization; /// @@ -24,4 +26,47 @@ public enum JobActionType [EnumMember(Value = "ServiceBusTopic")] ServiceBusTopic } + internal static class JobActionTypeEnumExtension + { + internal static string ToSerializedValue(this JobActionType? value) + { + return value == null ? null : ((JobActionType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this JobActionType value) + { + switch( value ) + { + case JobActionType.Http: + return "Http"; + case JobActionType.Https: + return "Https"; + case JobActionType.StorageQueue: + return "StorageQueue"; + case JobActionType.ServiceBusQueue: + return "ServiceBusQueue"; + case JobActionType.ServiceBusTopic: + return "ServiceBusTopic"; + } + return null; + } + + internal static JobActionType? ParseJobActionType(this string value) + { + switch( value ) + { + case "Http": + return JobActionType.Http; + case "Https": + return JobActionType.Https; + case "StorageQueue": + return JobActionType.StorageQueue; + case "ServiceBusQueue": + return JobActionType.ServiceBusQueue; + case "ServiceBusTopic": + return JobActionType.ServiceBusTopic; + } + return null; + } + } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionDefinition.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionDefinition.cs index 2092b193f8f7e..472fc538b0dbe 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionDefinition.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionDefinition.cs @@ -1,26 +1,37 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; public partial class JobCollectionDefinition { /// /// Initializes a new instance of the JobCollectionDefinition class. /// - public JobCollectionDefinition() { } + public JobCollectionDefinition() + { + CustomInit(); + } /// /// Initializes a new instance of the JobCollectionDefinition class. /// + /// Gets the job collection resource + /// identifier. + /// Gets the job collection resource type. + /// Gets or sets the job collection resource + /// name. + /// Gets or sets the storage account + /// location. + /// Gets or sets the tags. + /// Gets or sets the job collection + /// properties. public JobCollectionDefinition(string id = default(string), string type = default(string), string name = default(string), string location = default(string), IDictionary tags = default(IDictionary), JobCollectionProperties properties = default(JobCollectionProperties)) { Id = id; @@ -29,8 +40,14 @@ public JobCollectionDefinition() { } Location = location; Tags = tags; Properties = properties; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the job collection resource identifier. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionProperties.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionProperties.cs index 462fc24bb0167..57215f2122768 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionProperties.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionProperties.cs @@ -1,33 +1,42 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobCollectionProperties { /// /// Initializes a new instance of the JobCollectionProperties class. /// - public JobCollectionProperties() { } + public JobCollectionProperties() + { + CustomInit(); + } /// /// Initializes a new instance of the JobCollectionProperties class. /// + /// Gets or sets the SKU. + /// Gets or sets the state. Possible values + /// include: 'Enabled', 'Disabled', 'Suspended', 'Deleted' + /// Gets or sets the job collection quota. public JobCollectionProperties(Sku sku = default(Sku), JobCollectionState? state = default(JobCollectionState?), JobCollectionQuota quota = default(JobCollectionQuota)) { Sku = sku; State = state; Quota = quota; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the SKU. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionQuota.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionQuota.cs index 21cd261827d92..cb23dcf3f7e4b 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionQuota.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionQuota.cs @@ -1,33 +1,44 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobCollectionQuota { /// /// Initializes a new instance of the JobCollectionQuota class. /// - public JobCollectionQuota() { } + public JobCollectionQuota() + { + CustomInit(); + } /// /// Initializes a new instance of the JobCollectionQuota class. /// + /// Gets or set the maximum job + /// count. + /// Gets or sets the maximum job + /// occurrence. + /// Gets or set the maximum + /// recurrence. public JobCollectionQuota(int? maxJobCount = default(int?), int? maxJobOccurrence = default(int?), JobMaxRecurrence maxRecurrence = default(JobMaxRecurrence)) { MaxJobCount = maxJobCount; MaxJobOccurrence = maxJobOccurrence; MaxRecurrence = maxRecurrence; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or set the maximum job count. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionState.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionState.cs index cb597f3f3df65..c96fa378a0c68 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionState.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobCollectionState.cs @@ -1,10 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using System.Runtime; using System.Runtime.Serialization; /// @@ -22,4 +24,43 @@ public enum JobCollectionState [EnumMember(Value = "Deleted")] Deleted } + internal static class JobCollectionStateEnumExtension + { + internal static string ToSerializedValue(this JobCollectionState? value) + { + return value == null ? null : ((JobCollectionState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this JobCollectionState value) + { + switch( value ) + { + case JobCollectionState.Enabled: + return "Enabled"; + case JobCollectionState.Disabled: + return "Disabled"; + case JobCollectionState.Suspended: + return "Suspended"; + case JobCollectionState.Deleted: + return "Deleted"; + } + return null; + } + + internal static JobCollectionState? ParseJobCollectionState(this string value) + { + switch( value ) + { + case "Enabled": + return JobCollectionState.Enabled; + case "Disabled": + return JobCollectionState.Disabled; + case "Suspended": + return JobCollectionState.Suspended; + case "Deleted": + return JobCollectionState.Deleted; + } + return null; + } + } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobDefinition.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobDefinition.cs index d4950ede4b997..bcdee166e21c9 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobDefinition.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobDefinition.cs @@ -1,34 +1,43 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobDefinition { /// /// Initializes a new instance of the JobDefinition class. /// - public JobDefinition() { } + public JobDefinition() + { + CustomInit(); + } /// /// Initializes a new instance of the JobDefinition class. /// + /// Gets the job resource identifier. + /// Gets the job resource type. + /// Gets the job resource name. + /// Gets or sets the job properties. public JobDefinition(string id = default(string), string type = default(string), string name = default(string), JobProperties properties = default(JobProperties)) { Id = id; Type = type; Name = name; Properties = properties; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the job resource identifier. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobErrorAction.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobErrorAction.cs index c5dfee2d452a6..1b92fe35db742 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobErrorAction.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobErrorAction.cs @@ -1,26 +1,36 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobErrorAction { /// /// Initializes a new instance of the JobErrorAction class. /// - public JobErrorAction() { } + public JobErrorAction() + { + CustomInit(); + } /// /// Initializes a new instance of the JobErrorAction class. /// + /// Gets or sets the job error action type. Possible + /// values include: 'Http', 'Https', 'StorageQueue', 'ServiceBusQueue', + /// 'ServiceBusTopic' + /// Gets or sets the http requests. + /// Gets or sets the storage queue + /// message. + /// Gets or sets the service bus + /// queue message. + /// Gets or sets the service bus + /// topic message. + /// Gets or sets the retry policy. public JobErrorAction(JobActionType? type = default(JobActionType?), HttpRequest request = default(HttpRequest), StorageQueueMessage queueMessage = default(StorageQueueMessage), ServiceBusQueueMessage serviceBusQueueMessage = default(ServiceBusQueueMessage), ServiceBusTopicMessage serviceBusTopicMessage = default(ServiceBusTopicMessage), RetryPolicy retryPolicy = default(RetryPolicy)) { Type = type; @@ -29,8 +39,14 @@ public JobErrorAction() { } ServiceBusQueueMessage = serviceBusQueueMessage; ServiceBusTopicMessage = serviceBusTopicMessage; RetryPolicy = retryPolicy; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the job error action type. Possible values include: /// 'Http', 'Https', 'StorageQueue', 'ServiceBusQueue', diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobExecutionStatus.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobExecutionStatus.cs index 31fc93af8bdd3..2794e20396b20 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobExecutionStatus.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobExecutionStatus.cs @@ -1,10 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using System.Runtime; using System.Runtime.Serialization; /// @@ -20,4 +22,39 @@ public enum JobExecutionStatus [EnumMember(Value = "Postponed")] Postponed } + internal static class JobExecutionStatusEnumExtension + { + internal static string ToSerializedValue(this JobExecutionStatus? value) + { + return value == null ? null : ((JobExecutionStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this JobExecutionStatus value) + { + switch( value ) + { + case JobExecutionStatus.Completed: + return "Completed"; + case JobExecutionStatus.Failed: + return "Failed"; + case JobExecutionStatus.Postponed: + return "Postponed"; + } + return null; + } + + internal static JobExecutionStatus? ParseJobExecutionStatus(this string value) + { + switch( value ) + { + case "Completed": + return JobExecutionStatus.Completed; + case "Failed": + return JobExecutionStatus.Failed; + case "Postponed": + return JobExecutionStatus.Postponed; + } + return null; + } + } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryActionName.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryActionName.cs index 93a641ae89ba2..9e5dafdff3a7f 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryActionName.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryActionName.cs @@ -1,10 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using System.Runtime; using System.Runtime.Serialization; /// @@ -18,4 +20,35 @@ public enum JobHistoryActionName [EnumMember(Value = "ErrorAction")] ErrorAction } + internal static class JobHistoryActionNameEnumExtension + { + internal static string ToSerializedValue(this JobHistoryActionName? value) + { + return value == null ? null : ((JobHistoryActionName)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this JobHistoryActionName value) + { + switch( value ) + { + case JobHistoryActionName.MainAction: + return "MainAction"; + case JobHistoryActionName.ErrorAction: + return "ErrorAction"; + } + return null; + } + + internal static JobHistoryActionName? ParseJobHistoryActionName(this string value) + { + switch( value ) + { + case "MainAction": + return JobHistoryActionName.MainAction; + case "ErrorAction": + return JobHistoryActionName.ErrorAction; + } + return null; + } + } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryDefinition.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryDefinition.cs index e60b5011d3e33..4647cbb8322da 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryDefinition.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryDefinition.cs @@ -1,34 +1,44 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobHistoryDefinition { /// /// Initializes a new instance of the JobHistoryDefinition class. /// - public JobHistoryDefinition() { } + public JobHistoryDefinition() + { + CustomInit(); + } /// /// Initializes a new instance of the JobHistoryDefinition class. /// + /// Gets the job history identifier. + /// Gets the job history resource type. + /// Gets the job history name. + /// Gets or sets the job history + /// properties. public JobHistoryDefinition(string id = default(string), string type = default(string), string name = default(string), JobHistoryDefinitionProperties properties = default(JobHistoryDefinitionProperties)) { Id = id; Type = type; Name = name; Properties = properties; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the job history identifier. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryDefinitionProperties.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryDefinitionProperties.cs index 60224bad5e774..3c274d89d2d73 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryDefinitionProperties.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryDefinitionProperties.cs @@ -1,15 +1,11 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobHistoryDefinitionProperties { @@ -17,13 +13,28 @@ public partial class JobHistoryDefinitionProperties /// Initializes a new instance of the JobHistoryDefinitionProperties /// class. /// - public JobHistoryDefinitionProperties() { } + public JobHistoryDefinitionProperties() + { + CustomInit(); + } /// /// Initializes a new instance of the JobHistoryDefinitionProperties /// class. /// - public JobHistoryDefinitionProperties(DateTime? startTime = default(DateTime?), DateTime? endTime = default(DateTime?), DateTime? expectedExecutionTime = default(DateTime?), JobHistoryActionName? actionName = default(JobHistoryActionName?), JobExecutionStatus? status = default(JobExecutionStatus?), string message = default(string), int? retryCount = default(int?), int? repeatCount = default(int?)) + /// Gets the start time for this job. + /// Gets the end time for this job. + /// Gets the expected execution + /// time for this job. + /// Gets the job history action name. Possible + /// values include: 'MainAction', 'ErrorAction' + /// Gets the job history status. Possible values + /// include: 'Completed', 'Failed', 'Postponed' + /// Gets the message for the job history. + /// Gets the retry count for job. + /// Gets the repeat count for the + /// job. + public JobHistoryDefinitionProperties(System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), System.DateTime? expectedExecutionTime = default(System.DateTime?), JobHistoryActionName? actionName = default(JobHistoryActionName?), JobExecutionStatus? status = default(JobExecutionStatus?), string message = default(string), int? retryCount = default(int?), int? repeatCount = default(int?)) { StartTime = startTime; EndTime = endTime; @@ -33,25 +44,31 @@ public JobHistoryDefinitionProperties() { } Message = message; RetryCount = retryCount; RepeatCount = repeatCount; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the start time for this job. /// [JsonProperty(PropertyName = "startTime")] - public DateTime? StartTime { get; private set; } + public System.DateTime? StartTime { get; private set; } /// /// Gets the end time for this job. /// [JsonProperty(PropertyName = "endTime")] - public DateTime? EndTime { get; private set; } + public System.DateTime? EndTime { get; private set; } /// /// Gets the expected execution time for this job. /// [JsonProperty(PropertyName = "expectedExecutionTime")] - public DateTime? ExpectedExecutionTime { get; private set; } + public System.DateTime? ExpectedExecutionTime { get; private set; } /// /// Gets the job history action name. Possible values include: diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryFilter.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryFilter.cs index 8446d086f9029..8e899ae40657d 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryFilter.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobHistoryFilter.cs @@ -1,31 +1,38 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobHistoryFilter { /// /// Initializes a new instance of the JobHistoryFilter class. /// - public JobHistoryFilter() { } + public JobHistoryFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the JobHistoryFilter class. /// + /// Gets or sets the job execution status. + /// Possible values include: 'Completed', 'Failed', 'Postponed' public JobHistoryFilter(JobExecutionStatus? status = default(JobExecutionStatus?)) { Status = status; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the job execution status. Possible values include: /// 'Completed', 'Failed', 'Postponed' diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobMaxRecurrence.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobMaxRecurrence.cs index a3fcc2c766732..e0086c4e08eb9 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobMaxRecurrence.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobMaxRecurrence.cs @@ -1,32 +1,42 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobMaxRecurrence { /// /// Initializes a new instance of the JobMaxRecurrence class. /// - public JobMaxRecurrence() { } + public JobMaxRecurrence() + { + CustomInit(); + } /// /// Initializes a new instance of the JobMaxRecurrence class. /// + /// Gets or sets the frequency of recurrence + /// (second, minute, hour, day, week, month). Possible values include: + /// 'Minute', 'Hour', 'Day', 'Week', 'Month' + /// Gets or sets the interval between + /// retries. public JobMaxRecurrence(RecurrenceFrequency? frequency = default(RecurrenceFrequency?), int? interval = default(int?)) { Frequency = frequency; Interval = interval; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the frequency of recurrence (second, minute, hour, /// day, week, month). Possible values include: 'Minute', 'Hour', diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobProperties.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobProperties.cs index 9ea60df165b80..35b14c5c5b910 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobProperties.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobProperties.cs @@ -1,40 +1,51 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobProperties { /// /// Initializes a new instance of the JobProperties class. /// - public JobProperties() { } + public JobProperties() + { + CustomInit(); + } /// /// Initializes a new instance of the JobProperties class. /// - public JobProperties(DateTime? startTime = default(DateTime?), JobAction action = default(JobAction), JobRecurrence recurrence = default(JobRecurrence), JobState? state = default(JobState?), JobStatus status = default(JobStatus)) + /// Gets or sets the job start time. + /// Gets or sets the job action. + /// Gets or sets the job recurrence. + /// Gets or set the job state. Possible values + /// include: 'Enabled', 'Disabled', 'Faulted', 'Completed' + /// Gets the job status. + public JobProperties(System.DateTime? startTime = default(System.DateTime?), JobAction action = default(JobAction), JobRecurrence recurrence = default(JobRecurrence), JobState? state = default(JobState?), JobStatus status = default(JobStatus)) { StartTime = startTime; Action = action; Recurrence = recurrence; State = state; Status = status; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the job start time. /// [JsonProperty(PropertyName = "startTime")] - public DateTime? StartTime { get; set; } + public System.DateTime? StartTime { get; set; } /// /// Gets or sets the job action. diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobRecurrence.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobRecurrence.cs index 3e08541edfeb7..d2a848daa1f7c 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobRecurrence.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobRecurrence.cs @@ -1,35 +1,49 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobRecurrence { /// /// Initializes a new instance of the JobRecurrence class. /// - public JobRecurrence() { } + public JobRecurrence() + { + CustomInit(); + } /// /// Initializes a new instance of the JobRecurrence class. /// - public JobRecurrence(RecurrenceFrequency? frequency = default(RecurrenceFrequency?), int? interval = default(int?), int? count = default(int?), DateTime? endTime = default(DateTime?), JobRecurrenceSchedule schedule = default(JobRecurrenceSchedule)) + /// Gets or sets the frequency of recurrence + /// (second, minute, hour, day, week, month). Possible values include: + /// 'Minute', 'Hour', 'Day', 'Week', 'Month' + /// Gets or sets the interval between + /// retries. + /// Gets or sets the maximum number of times that + /// the job should run. + /// Gets or sets the time at which the job will + /// complete. + public JobRecurrence(RecurrenceFrequency? frequency = default(RecurrenceFrequency?), int? interval = default(int?), int? count = default(int?), System.DateTime? endTime = default(System.DateTime?), JobRecurrenceSchedule schedule = default(JobRecurrenceSchedule)) { Frequency = frequency; Interval = interval; Count = count; EndTime = endTime; Schedule = schedule; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the frequency of recurrence (second, minute, hour, /// day, week, month). Possible values include: 'Minute', 'Hour', @@ -54,7 +68,7 @@ public JobRecurrence() { } /// Gets or sets the time at which the job will complete. /// [JsonProperty(PropertyName = "endTime")] - public DateTime? EndTime { get; set; } + public System.DateTime? EndTime { get; set; } /// /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobRecurrenceSchedule.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobRecurrenceSchedule.cs index d8a4613096338..48ccfbf2c6ff0 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobRecurrenceSchedule.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobRecurrenceSchedule.cs @@ -1,26 +1,37 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; public partial class JobRecurrenceSchedule { /// /// Initializes a new instance of the JobRecurrenceSchedule class. /// - public JobRecurrenceSchedule() { } + public JobRecurrenceSchedule() + { + CustomInit(); + } /// /// Initializes a new instance of the JobRecurrenceSchedule class. /// + /// Gets or sets the days of the week that the + /// job should execute on. + /// Gets or sets the hours of the day that the job + /// should execute at. + /// Gets or sets the minutes of the hour that the + /// job should execute at. + /// Gets or sets the days of the month that the + /// job should execute on. Must be between 1 and 31. + /// Gets or sets the occurrences of + /// days within a month. public JobRecurrenceSchedule(IList weekDays = default(IList), IList hours = default(IList), IList minutes = default(IList), IList monthDays = default(IList), IList monthlyOccurrences = default(IList)) { WeekDays = weekDays; @@ -28,8 +39,14 @@ public JobRecurrenceSchedule() { } Minutes = minutes; MonthDays = monthDays; MonthlyOccurrences = monthlyOccurrences; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the days of the week that the job should execute on. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobRecurrenceScheduleMonthlyOccurrence.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobRecurrenceScheduleMonthlyOccurrence.cs index f3ceeb4d1bd01..1c5ae7bb0f7f1 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobRecurrenceScheduleMonthlyOccurrence.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobRecurrenceScheduleMonthlyOccurrence.cs @@ -1,15 +1,11 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobRecurrenceScheduleMonthlyOccurrence { @@ -17,23 +13,38 @@ public partial class JobRecurrenceScheduleMonthlyOccurrence /// Initializes a new instance of the /// JobRecurrenceScheduleMonthlyOccurrence class. /// - public JobRecurrenceScheduleMonthlyOccurrence() { } + public JobRecurrenceScheduleMonthlyOccurrence() + { + CustomInit(); + } /// /// Initializes a new instance of the /// JobRecurrenceScheduleMonthlyOccurrence class. /// + /// Gets or sets the day. Must be one of monday, + /// tuesday, wednesday, thursday, friday, saturday, sunday. Possible + /// values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', + /// 'Friday', 'Saturday', 'Sunday' + /// Gets or sets the occurrence. Must be + /// between -5 and 5. public JobRecurrenceScheduleMonthlyOccurrence(JobScheduleDay? day = default(JobScheduleDay?), int? occurrence = default(int?)) { Day = day; Occurrence = occurrence; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the day. Must be one of monday, tuesday, wednesday, /// thursday, friday, saturday, sunday. Possible values include: - /// 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', - /// 'Saturday', 'Sunday' + /// 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', + /// 'Sunday' /// [JsonProperty(PropertyName = "day")] public JobScheduleDay? Day { get; set; } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobScheduleDay.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobScheduleDay.cs index 399b5ea720f3b..19b62be093311 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobScheduleDay.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobScheduleDay.cs @@ -1,10 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using System.Runtime; using System.Runtime.Serialization; /// @@ -28,4 +30,55 @@ public enum JobScheduleDay [EnumMember(Value = "Sunday")] Sunday } + internal static class JobScheduleDayEnumExtension + { + internal static string ToSerializedValue(this JobScheduleDay? value) + { + return value == null ? null : ((JobScheduleDay)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this JobScheduleDay value) + { + switch( value ) + { + case JobScheduleDay.Monday: + return "Monday"; + case JobScheduleDay.Tuesday: + return "Tuesday"; + case JobScheduleDay.Wednesday: + return "Wednesday"; + case JobScheduleDay.Thursday: + return "Thursday"; + case JobScheduleDay.Friday: + return "Friday"; + case JobScheduleDay.Saturday: + return "Saturday"; + case JobScheduleDay.Sunday: + return "Sunday"; + } + return null; + } + + internal static JobScheduleDay? ParseJobScheduleDay(this string value) + { + switch( value ) + { + case "Monday": + return JobScheduleDay.Monday; + case "Tuesday": + return JobScheduleDay.Tuesday; + case "Wednesday": + return JobScheduleDay.Wednesday; + case "Thursday": + return JobScheduleDay.Thursday; + case "Friday": + return JobScheduleDay.Friday; + case "Saturday": + return JobScheduleDay.Saturday; + case "Sunday": + return JobScheduleDay.Sunday; + } + return null; + } + } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobState.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobState.cs index a2479e6e57d59..99777a2703bc4 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobState.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobState.cs @@ -1,10 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using System.Runtime; using System.Runtime.Serialization; /// @@ -22,4 +24,43 @@ public enum JobState [EnumMember(Value = "Completed")] Completed } + internal static class JobStateEnumExtension + { + internal static string ToSerializedValue(this JobState? value) + { + return value == null ? null : ((JobState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this JobState value) + { + switch( value ) + { + case JobState.Enabled: + return "Enabled"; + case JobState.Disabled: + return "Disabled"; + case JobState.Faulted: + return "Faulted"; + case JobState.Completed: + return "Completed"; + } + return null; + } + + internal static JobState? ParseJobState(this string value) + { + switch( value ) + { + case "Enabled": + return JobState.Enabled; + case "Disabled": + return JobState.Disabled; + case "Faulted": + return JobState.Faulted; + case "Completed": + return JobState.Completed; + } + return null; + } + } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobStateFilter.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobStateFilter.cs index 1cc945eb0a550..3f8ded9e1733a 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobStateFilter.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobStateFilter.cs @@ -1,31 +1,38 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobStateFilter { /// /// Initializes a new instance of the JobStateFilter class. /// - public JobStateFilter() { } + public JobStateFilter() + { + CustomInit(); + } /// /// Initializes a new instance of the JobStateFilter class. /// + /// Gets or sets the job state. Possible values + /// include: 'Enabled', 'Disabled', 'Faulted', 'Completed' public JobStateFilter(JobState? state = default(JobState?)) { State = state; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the job state. Possible values include: 'Enabled', /// 'Disabled', 'Faulted', 'Completed' diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobStatus.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobStatus.cs index badef5e74e88a..12482d7c9697e 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobStatus.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/JobStatus.cs @@ -1,35 +1,53 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class JobStatus { /// /// Initializes a new instance of the JobStatus class. /// - public JobStatus() { } + public JobStatus() + { + CustomInit(); + } /// /// Initializes a new instance of the JobStatus class. /// - public JobStatus(int? executionCount = default(int?), int? failureCount = default(int?), int? faultedCount = default(int?), DateTime? lastExecutionTime = default(DateTime?), DateTime? nextExecutionTime = default(DateTime?)) + /// Gets the number of times this job has + /// executed. + /// Gets the number of times this job has + /// failed. + /// Gets the number of faulted occurrences + /// (occurrences that were retried and failed as many times as the + /// retry policy states). + /// Gets the time the last occurrence + /// executed in ISO-8601 format. Could be empty if job has not run + /// yet. + /// Gets the time of the next + /// occurrence in ISO-8601 format. Could be empty if the job is + /// completed. + public JobStatus(int? executionCount = default(int?), int? failureCount = default(int?), int? faultedCount = default(int?), System.DateTime? lastExecutionTime = default(System.DateTime?), System.DateTime? nextExecutionTime = default(System.DateTime?)) { ExecutionCount = executionCount; FailureCount = failureCount; FaultedCount = faultedCount; LastExecutionTime = lastExecutionTime; NextExecutionTime = nextExecutionTime; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the number of times this job has executed. /// @@ -54,14 +72,14 @@ public JobStatus() { } /// Could be empty if job has not run yet. /// [JsonProperty(PropertyName = "lastExecutionTime")] - public DateTime? LastExecutionTime { get; private set; } + public System.DateTime? LastExecutionTime { get; private set; } /// /// Gets the time of the next occurrence in ISO-8601 format. Could be /// empty if the job is completed. /// [JsonProperty(PropertyName = "nextExecutionTime")] - public DateTime? NextExecutionTime { get; private set; } + public System.DateTime? NextExecutionTime { get; private set; } } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/OAuthAuthentication.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/OAuthAuthentication.cs index 40f4266ea7b78..60f7d4e130001 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/OAuthAuthentication.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/OAuthAuthentication.cs @@ -1,35 +1,45 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; + [Newtonsoft.Json.JsonObject("ActiveDirectoryOAuth")] public partial class OAuthAuthentication : HttpAuthentication { /// /// Initializes a new instance of the OAuthAuthentication class. /// - public OAuthAuthentication() { } + public OAuthAuthentication() + { + CustomInit(); + } /// /// Initializes a new instance of the OAuthAuthentication class. /// - public OAuthAuthentication(HttpAuthenticationType? type = default(HttpAuthenticationType?), string secret = default(string), string tenant = default(string), string audience = default(string), string clientId = default(string)) - : base(type) + /// Gets or sets the secret, return value will + /// always be empty. + /// Gets or sets the tenant. + /// Gets or sets the audience. + /// Gets or sets the client identifier. + public OAuthAuthentication(string secret = default(string), string tenant = default(string), string audience = default(string), string clientId = default(string)) { Secret = secret; Tenant = tenant; Audience = audience; ClientId = clientId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the secret, return value will always be empty. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/Page.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/Page.cs index 8003e165983ec..bd1b33a682089 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/Page.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/Page.cs @@ -1,12 +1,14 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System.Collections.Generic; - using System.Linq; - using Newtonsoft.Json; + using Microsoft.Rest; using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; /// /// Defines a page in Azure responses. @@ -30,14 +32,14 @@ public class Page : IPage /// A an enumerator that can be used to iterate through the collection. public IEnumerator GetEnumerator() { - return (Items == null) ? Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/RecurrenceFrequency.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/RecurrenceFrequency.cs index 7e414a4e183b7..a263f0f603bad 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/RecurrenceFrequency.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/RecurrenceFrequency.cs @@ -1,10 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using System.Runtime; using System.Runtime.Serialization; /// @@ -24,4 +26,47 @@ public enum RecurrenceFrequency [EnumMember(Value = "Month")] Month } + internal static class RecurrenceFrequencyEnumExtension + { + internal static string ToSerializedValue(this RecurrenceFrequency? value) + { + return value == null ? null : ((RecurrenceFrequency)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this RecurrenceFrequency value) + { + switch( value ) + { + case RecurrenceFrequency.Minute: + return "Minute"; + case RecurrenceFrequency.Hour: + return "Hour"; + case RecurrenceFrequency.Day: + return "Day"; + case RecurrenceFrequency.Week: + return "Week"; + case RecurrenceFrequency.Month: + return "Month"; + } + return null; + } + + internal static RecurrenceFrequency? ParseRecurrenceFrequency(this string value) + { + switch( value ) + { + case "Minute": + return RecurrenceFrequency.Minute; + case "Hour": + return RecurrenceFrequency.Hour; + case "Day": + return RecurrenceFrequency.Day; + case "Week": + return RecurrenceFrequency.Week; + case "Month": + return RecurrenceFrequency.Month; + } + return null; + } + } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/RetryPolicy.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/RetryPolicy.cs index 7f031878f0cd9..384c3a4d56b7c 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/RetryPolicy.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/RetryPolicy.cs @@ -1,33 +1,44 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class RetryPolicy { /// /// Initializes a new instance of the RetryPolicy class. /// - public RetryPolicy() { } + public RetryPolicy() + { + CustomInit(); + } /// /// Initializes a new instance of the RetryPolicy class. /// - public RetryPolicy(RetryType? retryType = default(RetryType?), TimeSpan? retryInterval = default(TimeSpan?), int? retryCount = default(int?)) + /// Gets or sets the retry strategy to be used. + /// Possible values include: 'None', 'Fixed' + /// Gets or sets the retry interval between + /// retries, specify duration in ISO 8601 format. + /// Gets or sets the number of times a retry + /// should be attempted. + public RetryPolicy(RetryType? retryType = default(RetryType?), System.TimeSpan? retryInterval = default(System.TimeSpan?), int? retryCount = default(int?)) { RetryType = retryType; RetryInterval = retryInterval; RetryCount = retryCount; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the retry strategy to be used. Possible values /// include: 'None', 'Fixed' @@ -40,7 +51,7 @@ public RetryPolicy() { } /// in ISO 8601 format. /// [JsonProperty(PropertyName = "retryInterval")] - public TimeSpan? RetryInterval { get; set; } + public System.TimeSpan? RetryInterval { get; set; } /// /// Gets or sets the number of times a retry should be attempted. diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/RetryType.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/RetryType.cs index 5c6ddc085bad7..d9184c220db40 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/RetryType.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/RetryType.cs @@ -1,10 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using System.Runtime; using System.Runtime.Serialization; /// @@ -18,4 +20,35 @@ public enum RetryType [EnumMember(Value = "Fixed")] Fixed } + internal static class RetryTypeEnumExtension + { + internal static string ToSerializedValue(this RetryType? value) + { + return value == null ? null : ((RetryType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this RetryType value) + { + switch( value ) + { + case RetryType.None: + return "None"; + case RetryType.Fixed: + return "Fixed"; + } + return null; + } + + internal static RetryType? ParseRetryType(this string value) + { + switch( value ) + { + case "None": + return RetryType.None; + case "Fixed": + return RetryType.Fixed; + } + return null; + } + } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusAuthentication.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusAuthentication.cs index f13c07ac1ed23..dae2f445f30b2 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusAuthentication.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusAuthentication.cs @@ -1,33 +1,42 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class ServiceBusAuthentication { /// /// Initializes a new instance of the ServiceBusAuthentication class. /// - public ServiceBusAuthentication() { } + public ServiceBusAuthentication() + { + CustomInit(); + } /// /// Initializes a new instance of the ServiceBusAuthentication class. /// + /// Gets or sets the SAS key. + /// Gets or sets the SAS key name. + /// Gets or sets the authentication type. Possible + /// values include: 'NotSpecified', 'SharedAccessKey' public ServiceBusAuthentication(string sasKey = default(string), string sasKeyName = default(string), ServiceBusAuthenticationType? type = default(ServiceBusAuthenticationType?)) { SasKey = sasKey; SasKeyName = sasKeyName; Type = type; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the SAS key. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusAuthenticationType.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusAuthenticationType.cs index 160587cff2311..6ca2b6bce902c 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusAuthenticationType.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusAuthenticationType.cs @@ -1,10 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using System.Runtime; using System.Runtime.Serialization; /// @@ -18,4 +20,35 @@ public enum ServiceBusAuthenticationType [EnumMember(Value = "SharedAccessKey")] SharedAccessKey } + internal static class ServiceBusAuthenticationTypeEnumExtension + { + internal static string ToSerializedValue(this ServiceBusAuthenticationType? value) + { + return value == null ? null : ((ServiceBusAuthenticationType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ServiceBusAuthenticationType value) + { + switch( value ) + { + case ServiceBusAuthenticationType.NotSpecified: + return "NotSpecified"; + case ServiceBusAuthenticationType.SharedAccessKey: + return "SharedAccessKey"; + } + return null; + } + + internal static ServiceBusAuthenticationType? ParseServiceBusAuthenticationType(this string value) + { + switch( value ) + { + case "NotSpecified": + return ServiceBusAuthenticationType.NotSpecified; + case "SharedAccessKey": + return ServiceBusAuthenticationType.SharedAccessKey; + } + return null; + } + } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusBrokeredMessageProperties.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusBrokeredMessageProperties.cs index dc3fa5f6de3f1..2922516909642 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusBrokeredMessageProperties.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusBrokeredMessageProperties.cs @@ -1,15 +1,11 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class ServiceBusBrokeredMessageProperties { @@ -17,13 +13,34 @@ public partial class ServiceBusBrokeredMessageProperties /// Initializes a new instance of the /// ServiceBusBrokeredMessageProperties class. /// - public ServiceBusBrokeredMessageProperties() { } + public ServiceBusBrokeredMessageProperties() + { + CustomInit(); + } /// /// Initializes a new instance of the /// ServiceBusBrokeredMessageProperties class. /// - public ServiceBusBrokeredMessageProperties(string contentType = default(string), string correlationId = default(string), bool? forcePersistence = default(bool?), string label = default(string), string messageId = default(string), string partitionKey = default(string), string replyTo = default(string), string replyToSessionId = default(string), DateTime? scheduledEnqueueTimeUtc = default(DateTime?), string sessionId = default(string), TimeSpan? timeToLive = default(TimeSpan?), string to = default(string), string viaPartitionKey = default(string)) + /// Gets or sets the content type. + /// Gets or sets the correlation + /// ID. + /// Gets or sets the force + /// persistence. + /// Gets or sets the label. + /// Gets or sets the message ID. + /// Gets or sets the partition key. + /// Gets or sets the reply to. + /// Gets or sets the reply to session + /// ID. + /// Gets or sets the scheduled + /// enqueue time UTC. + /// Gets or sets the session ID. + /// Gets or sets the time to live. + /// Gets or sets the to. + /// Gets or sets the via partition + /// key. + public ServiceBusBrokeredMessageProperties(string contentType = default(string), string correlationId = default(string), bool? forcePersistence = default(bool?), string label = default(string), string messageId = default(string), string partitionKey = default(string), string replyTo = default(string), string replyToSessionId = default(string), System.DateTime? scheduledEnqueueTimeUtc = default(System.DateTime?), string sessionId = default(string), System.TimeSpan? timeToLive = default(System.TimeSpan?), string to = default(string), string viaPartitionKey = default(string)) { ContentType = contentType; CorrelationId = correlationId; @@ -38,8 +55,14 @@ public ServiceBusBrokeredMessageProperties() { } TimeToLive = timeToLive; To = to; ViaPartitionKey = viaPartitionKey; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the content type. /// @@ -92,7 +115,7 @@ public ServiceBusBrokeredMessageProperties() { } /// Gets or sets the scheduled enqueue time UTC. /// [JsonProperty(PropertyName = "scheduledEnqueueTimeUtc")] - public DateTime? ScheduledEnqueueTimeUtc { get; set; } + public System.DateTime? ScheduledEnqueueTimeUtc { get; set; } /// /// Gets or sets the session ID. @@ -104,7 +127,7 @@ public ServiceBusBrokeredMessageProperties() { } /// Gets or sets the time to live. /// [JsonProperty(PropertyName = "timeToLive")] - public TimeSpan? TimeToLive { get; set; } + public System.TimeSpan? TimeToLive { get; set; } /// /// Gets or sets the to. diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusMessage.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusMessage.cs index 72fc457378bd0..7eba5df5adb10 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusMessage.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusMessage.cs @@ -1,26 +1,38 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; public partial class ServiceBusMessage { /// /// Initializes a new instance of the ServiceBusMessage class. /// - public ServiceBusMessage() { } + public ServiceBusMessage() + { + CustomInit(); + } /// /// Initializes a new instance of the ServiceBusMessage class. /// + /// Gets or sets the Service Bus + /// authentication. + /// Gets or sets the brokered + /// message properties. + /// Gets or sets the custom + /// message properties. + /// Gets or sets the message. + /// Gets or sets the namespace. + /// Gets or sets the transport type. + /// Possible values include: 'NotSpecified', 'NetMessaging', + /// 'AMQP' public ServiceBusMessage(ServiceBusAuthentication authentication = default(ServiceBusAuthentication), ServiceBusBrokeredMessageProperties brokeredMessageProperties = default(ServiceBusBrokeredMessageProperties), IDictionary customMessageProperties = default(IDictionary), string message = default(string), string namespaceProperty = default(string), ServiceBusTransportType? transportType = default(ServiceBusTransportType?)) { Authentication = authentication; @@ -29,8 +41,14 @@ public ServiceBusMessage() { } Message = message; NamespaceProperty = namespaceProperty; TransportType = transportType; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the Service Bus authentication. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusQueueMessage.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusQueueMessage.cs index fdd2759fc1e2c..1f365820345bc 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusQueueMessage.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusQueueMessage.cs @@ -1,32 +1,51 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; public partial class ServiceBusQueueMessage : ServiceBusMessage { /// /// Initializes a new instance of the ServiceBusQueueMessage class. /// - public ServiceBusQueueMessage() { } + public ServiceBusQueueMessage() + { + CustomInit(); + } /// /// Initializes a new instance of the ServiceBusQueueMessage class. /// + /// Gets or sets the Service Bus + /// authentication. + /// Gets or sets the brokered + /// message properties. + /// Gets or sets the custom + /// message properties. + /// Gets or sets the message. + /// Gets or sets the namespace. + /// Gets or sets the transport type. + /// Possible values include: 'NotSpecified', 'NetMessaging', + /// 'AMQP' + /// Gets or sets the queue name. public ServiceBusQueueMessage(ServiceBusAuthentication authentication = default(ServiceBusAuthentication), ServiceBusBrokeredMessageProperties brokeredMessageProperties = default(ServiceBusBrokeredMessageProperties), IDictionary customMessageProperties = default(IDictionary), string message = default(string), string namespaceProperty = default(string), ServiceBusTransportType? transportType = default(ServiceBusTransportType?), string queueName = default(string)) : base(authentication, brokeredMessageProperties, customMessageProperties, message, namespaceProperty, transportType) { QueueName = queueName; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the queue name. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusTopicMessage.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusTopicMessage.cs index 7ea0126b03282..2a1dba9d9e6d1 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusTopicMessage.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusTopicMessage.cs @@ -1,32 +1,51 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; public partial class ServiceBusTopicMessage : ServiceBusMessage { /// /// Initializes a new instance of the ServiceBusTopicMessage class. /// - public ServiceBusTopicMessage() { } + public ServiceBusTopicMessage() + { + CustomInit(); + } /// /// Initializes a new instance of the ServiceBusTopicMessage class. /// + /// Gets or sets the Service Bus + /// authentication. + /// Gets or sets the brokered + /// message properties. + /// Gets or sets the custom + /// message properties. + /// Gets or sets the message. + /// Gets or sets the namespace. + /// Gets or sets the transport type. + /// Possible values include: 'NotSpecified', 'NetMessaging', + /// 'AMQP' + /// Gets or sets the topic path. public ServiceBusTopicMessage(ServiceBusAuthentication authentication = default(ServiceBusAuthentication), ServiceBusBrokeredMessageProperties brokeredMessageProperties = default(ServiceBusBrokeredMessageProperties), IDictionary customMessageProperties = default(IDictionary), string message = default(string), string namespaceProperty = default(string), ServiceBusTransportType? transportType = default(ServiceBusTransportType?), string topicPath = default(string)) : base(authentication, brokeredMessageProperties, customMessageProperties, message, namespaceProperty, transportType) { TopicPath = topicPath; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the topic path. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusTransportType.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusTransportType.cs index 775ce2d4e7a6e..84ff27e97cd9d 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusTransportType.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/ServiceBusTransportType.cs @@ -1,10 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using System.Runtime; using System.Runtime.Serialization; /// @@ -20,4 +22,39 @@ public enum ServiceBusTransportType [EnumMember(Value = "AMQP")] AMQP } + internal static class ServiceBusTransportTypeEnumExtension + { + internal static string ToSerializedValue(this ServiceBusTransportType? value) + { + return value == null ? null : ((ServiceBusTransportType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ServiceBusTransportType value) + { + switch( value ) + { + case ServiceBusTransportType.NotSpecified: + return "NotSpecified"; + case ServiceBusTransportType.NetMessaging: + return "NetMessaging"; + case ServiceBusTransportType.AMQP: + return "AMQP"; + } + return null; + } + + internal static ServiceBusTransportType? ParseServiceBusTransportType(this string value) + { + switch( value ) + { + case "NotSpecified": + return ServiceBusTransportType.NotSpecified; + case "NetMessaging": + return ServiceBusTransportType.NetMessaging; + case "AMQP": + return ServiceBusTransportType.AMQP; + } + return null; + } + } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/Sku.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/Sku.cs index 38494cb8dffe9..cda36bd0dd89f 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/Sku.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/Sku.cs @@ -1,31 +1,38 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class Sku { /// /// Initializes a new instance of the Sku class. /// - public Sku() { } + public Sku() + { + CustomInit(); + } /// /// Initializes a new instance of the Sku class. /// + /// Gets or set the SKU. Possible values include: + /// 'Standard', 'Free', 'P10Premium', 'P20Premium' public Sku(SkuDefinition? name = default(SkuDefinition?)) { Name = name; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or set the SKU. Possible values include: 'Standard', 'Free', /// 'P10Premium', 'P20Premium' diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/SkuDefinition.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/SkuDefinition.cs index 463a6110beb83..ef7b546fa25e8 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/SkuDefinition.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/SkuDefinition.cs @@ -1,10 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using System.Runtime; using System.Runtime.Serialization; /// @@ -22,4 +24,43 @@ public enum SkuDefinition [EnumMember(Value = "P20Premium")] P20Premium } + internal static class SkuDefinitionEnumExtension + { + internal static string ToSerializedValue(this SkuDefinition? value) + { + return value == null ? null : ((SkuDefinition)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SkuDefinition value) + { + switch( value ) + { + case SkuDefinition.Standard: + return "Standard"; + case SkuDefinition.Free: + return "Free"; + case SkuDefinition.P10Premium: + return "P10Premium"; + case SkuDefinition.P20Premium: + return "P20Premium"; + } + return null; + } + + internal static SkuDefinition? ParseSkuDefinition(this string value) + { + switch( value ) + { + case "Standard": + return SkuDefinition.Standard; + case "Free": + return SkuDefinition.Free; + case "P10Premium": + return SkuDefinition.P10Premium; + case "P20Premium": + return SkuDefinition.P20Premium; + } + return null; + } + } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/StorageQueueMessage.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/StorageQueueMessage.cs index 2b743380cacf2..94861aff090ad 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/StorageQueueMessage.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/Models/StorageQueueMessage.cs @@ -1,34 +1,44 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler.Models { - using System; - using System.Linq; - using System.Collections.Generic; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class StorageQueueMessage { /// /// Initializes a new instance of the StorageQueueMessage class. /// - public StorageQueueMessage() { } + public StorageQueueMessage() + { + CustomInit(); + } /// /// Initializes a new instance of the StorageQueueMessage class. /// + /// Gets or sets the storage account + /// name. + /// Gets or sets the queue name. + /// Gets or sets the SAS key. + /// Gets or sets the message. public StorageQueueMessage(string storageAccount = default(string), string queueName = default(string), string sasToken = default(string), string message = default(string)) { StorageAccount = storageAccount; QueueName = queueName; SasToken = sasToken; Message = message; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the storage account name. /// diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/SchedulerManagementClient.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/SchedulerManagementClient.cs index 74308f9f3402b..1c08d0fd35137 100644 --- a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/SchedulerManagementClient.cs +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/SchedulerManagementClient.cs @@ -1,31 +1,26 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// +// namespace Microsoft.Azure.Management.Scheduler { - using System; - using System.Linq; - using System.Collections.Generic; - using System.Diagnostics; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using System.Threading.Tasks; using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; 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; public partial class SchedulerManagementClient : ServiceClient, ISchedulerManagementClient, IAzureClient { /// /// The base URI of the service. /// - public Uri BaseUri { get; set; } + public System.Uri BaseUri { get; set; } /// /// Gets or sets json serialization settings. @@ -35,10 +30,10 @@ public partial class SchedulerManagementClient : ServiceClient /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } + public JsonSerializerSettings DeserializationSettings { get; private set; } /// - /// Gets Azure subscription credentials. + /// Credentials needed for the client to connect to Azure. /// public ServiceClientCredentials Credentials { get; private set; } @@ -53,19 +48,20 @@ public partial class SchedulerManagementClient : ServiceClient - /// 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; } @@ -79,6 +75,19 @@ public partial class SchedulerManagementClient : ServiceClient public virtual IJobsOperations Jobs { get; private set; } + /// + /// Initializes a new instance of the SchedulerManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling SchedulerManagementClient.Dispose(). False: will not dispose provided httpClient + protected SchedulerManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + /// /// Initializes a new instance of the SchedulerManagementClient class. /// @@ -87,7 +96,7 @@ public partial class SchedulerManagementClient : ServiceClient protected SchedulerManagementClient(params DelegatingHandler[] handlers) : base(handlers) { - this.Initialize(); + Initialize(); } /// @@ -101,7 +110,7 @@ protected SchedulerManagementClient(params DelegatingHandler[] handlers) : base( /// protected SchedulerManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { - this.Initialize(); + Initialize(); } /// @@ -113,13 +122,16 @@ protected SchedulerManagementClient(HttpClientHandler rootHandler, params Delega /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected SchedulerManagementClient(Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + /// + /// Thrown when a required parameter is null + /// + protected SchedulerManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { - throw new ArgumentNullException("baseUri"); + throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -134,34 +146,67 @@ protected SchedulerManagementClient(Uri baseUri, params DelegatingHandler[] hand /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected SchedulerManagementClient(Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + /// + /// Thrown when a required parameter is null + /// + protected SchedulerManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { - throw new ArgumentNullException("baseUri"); + throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// /// Initializes a new instance of the SchedulerManagementClient class. /// /// - /// Required. Gets Azure subscription credentials. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// + /// + /// Thrown when a required parameter is null + /// public SchedulerManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { - throw new ArgumentNullException("credentials"); + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the SchedulerManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling SchedulerManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public SchedulerManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + 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); } } @@ -169,7 +214,7 @@ public SchedulerManagementClient(ServiceClientCredentials credentials, params De /// Initializes a new instance of the SchedulerManagementClient class. /// /// - /// Required. Gets Azure subscription credentials. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. @@ -177,16 +222,19 @@ public SchedulerManagementClient(ServiceClientCredentials credentials, params De /// /// Optional. The delegating handlers to add to the http client pipeline. /// + /// + /// Thrown when a required parameter is null + /// public SchedulerManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { - throw new ArgumentNullException("credentials"); + throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -197,26 +245,29 @@ public SchedulerManagementClient(ServiceClientCredentials credentials, HttpClien /// Optional. The base URI of the service. /// /// - /// Required. Gets Azure subscription credentials. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - public SchedulerManagementClient(Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + /// + /// Thrown when a required parameter is null + /// + public SchedulerManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { - throw new ArgumentNullException("baseUri"); + throw new System.ArgumentNullException("baseUri"); } if (credentials == null) { - throw new ArgumentNullException("credentials"); + 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); } } @@ -227,7 +278,7 @@ public SchedulerManagementClient(Uri baseUri, ServiceClientCredentials credentia /// Optional. The base URI of the service. /// /// - /// Required. Gets Azure subscription credentials. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. @@ -235,66 +286,72 @@ public SchedulerManagementClient(Uri baseUri, ServiceClientCredentials credentia /// /// Optional. The delegating handlers to add to the http client pipeline. /// - public SchedulerManagementClient(Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + /// + /// Thrown when a required parameter is null + /// + public SchedulerManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { - throw new ArgumentNullException("baseUri"); + throw new System.ArgumentNullException("baseUri"); } if (credentials == null) { - throw new ArgumentNullException("credentials"); + 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); } } + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); /// /// Initializes client properties. /// private void Initialize() { - this.JobCollections = new JobCollectionsOperations(this); - this.Jobs = new JobsOperations(this); - this.BaseUri = new Uri("https://management.azure.com"); - this.ApiVersion = "2016-03-01"; - this.AcceptLanguage = "en-US"; - this.LongRunningOperationRetryTimeout = 30; - this.GenerateClientRequestId = true; + JobCollections = new JobCollectionsOperations(this); + Jobs = new JobsOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2016-03-01"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { - Formatting = Formatting.Indented, - DateFormatHandling = DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = DateTimeZoneHandling.Utc, - NullValueHandling = NullValueHandling.Ignore, - ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + 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 ReadOnlyJsonContractResolver(), - //// NOTE (pinwang): Scheduler supports Non ISO format TimeSpan and - //// SDK Iso8601TimeSpanConverter will only convert ISO format for TimeSpan. - ////Converters = new List - //// { - //// new Iso8601TimeSpanConverter() - //// } + Converters = new List + { + new Iso8601TimeSpanConverter() + } }; DeserializationSettings = new JsonSerializerSettings { - DateFormatHandling = DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = DateTimeZoneHandling.Utc, - NullValueHandling = NullValueHandling.Ignore, - ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), - //// NOTE (pinwang): Scheduler supports Non ISO format TimeSpan and - //// SDK Iso8601TimeSpanConverter will only convert ISO format for TimeSpan. - ////Converters = new List - //// { - //// new Iso8601TimeSpanConverter() - //// } + Converters = new List + { + new Iso8601TimeSpanConverter() + } }; - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); - } + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + CustomInitialize(); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } } } diff --git a/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/SdkInfo_SchedulerManagementClient.cs b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/SdkInfo_SchedulerManagementClient.cs new file mode 100644 index 0000000000000..f3f7e35c86505 --- /dev/null +++ b/sdk/scheduler/Microsoft.Azure.Management.Scheduler/src/Generated/SdkInfo_SchedulerManagementClient.cs @@ -0,0 +1,28 @@ + +// +// 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.Scheduler +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_SchedulerManagementClient + { + get + { + return new Tuple[] + { + new Tuple("Scheduler", "JobCollections", "2016-03-01"), + new Tuple("Scheduler", "Jobs", "2016-03-01"), + }.AsEnumerable(); + } + } + } +}