From ace0a32dcb6569acb5da5a9ceeba012f4bd9bd02 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 5 Dec 2019 02:05:03 +0000 Subject: [PATCH] Generated from 51b036cebaaab5bfe972a2d6e23ca0efa53de076 Microsoft.AAD/DomainService: Add 2020-01-01 api-version --- .../src/Generated/DomainServiceOperations.cs | 400 ++++ .../DomainServiceOperationsExtensions.cs | 87 + .../src/Generated/DomainServicesOperations.cs | 1815 +++++++++++++++++ .../DomainServicesOperationsExtensions.cs | 569 ++++++ .../DomainServicesResourceProviderClient.cs | 368 ++++ .../src/Generated/IDomainServiceOperations.cs | 68 + .../Generated/IDomainServicesOperations.cs | 355 ++++ .../IDomainServicesResourceProviderClient.cs | 85 + .../Models/DomainSecuritySettings.cs | 77 + .../src/Generated/Models/DomainService.cs | 183 ++ .../src/Generated/Models/ExternalAccess.cs | 22 + .../src/Generated/Models/FilteredSync.cs | 22 + .../src/Generated/Models/HealthAlert.cs | 100 + .../src/Generated/Models/HealthMonitor.cs | 67 + .../src/Generated/Models/Ldaps.cs | 22 + .../src/Generated/Models/LdapsSettings.cs | 124 ++ .../Generated/Models/NotificationSettings.cs | 74 + .../src/Generated/Models/NotifyDcAdmins.cs | 22 + .../Generated/Models/NotifyGlobalAdmins.cs | 22 + .../src/Generated/Models/NtlmV1.cs | 22 + .../Generated/Models/OperationDisplayInfo.cs | 78 + .../src/Generated/Models/OperationEntity.cs | 69 + .../src/Generated/Models/Page.cs | 53 + .../src/Generated/Models/Resource.cs | 95 + .../src/Generated/Models/SyncNtlmPasswords.cs | 22 + .../src/Generated/Models/TlsV1.cs | 22 + .../SdkInfo_DomainServicesResourceProvider.cs | 28 + 27 files changed, 4871 insertions(+) create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServiceOperations.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServiceOperationsExtensions.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServicesOperations.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServicesOperationsExtensions.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServicesResourceProviderClient.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/IDomainServiceOperations.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/IDomainServicesOperations.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/IDomainServicesResourceProviderClient.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/DomainSecuritySettings.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/DomainService.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/ExternalAccess.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/FilteredSync.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/HealthAlert.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/HealthMonitor.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/Ldaps.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/LdapsSettings.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NotificationSettings.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NotifyDcAdmins.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NotifyGlobalAdmins.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NtlmV1.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/OperationDisplayInfo.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/OperationEntity.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/Page.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/Resource.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/SyncNtlmPasswords.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/TlsV1.cs create mode 100644 sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/SdkInfo_DomainServicesResourceProvider.cs diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServiceOperations.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServiceOperations.cs new file mode 100644 index 000000000000..1ad091da5a24 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServiceOperations.cs @@ -0,0 +1,400 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DomainServiceOperations operations. + /// + internal partial class DomainServiceOperations : IServiceOperations, IDomainServiceOperations + { + /// + /// Initializes a new instance of the DomainServiceOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DomainServiceOperations(DomainServicesResourceProviderClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DomainServicesResourceProviderClient + /// + public DomainServicesResourceProviderClient Client { get; private set; } + + /// + /// Lists all the available Domain Services operations. + /// + /// + /// Headers that will be added to request. + /// + /// + /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.AAD/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + 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")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the available Domain Services operations. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + 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")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServiceOperationsExtensions.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServiceOperationsExtensions.cs new file mode 100644 index 000000000000..93bbe2bba989 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServiceOperationsExtensions.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DomainServiceOperations. + /// + public static partial class DomainServiceOperationsExtensions + { + /// + /// Lists all the available Domain Services operations. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IDomainServiceOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the available Domain Services operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IDomainServiceOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the available Domain Services operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IDomainServiceOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available Domain Services operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IDomainServiceOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServicesOperations.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServicesOperations.cs new file mode 100644 index 000000000000..879de455838c --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServicesOperations.cs @@ -0,0 +1,1815 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DomainServicesOperations operations. + /// + internal partial class DomainServicesOperations : IServiceOperations, IDomainServicesOperations + { + /// + /// Initializes a new instance of the DomainServicesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DomainServicesOperations(DomainServicesResourceProviderClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DomainServicesResourceProviderClient + /// + public DomainServicesResourceProviderClient Client { get; private set; } + + /// + /// List Domain Services in Subscription + /// + /// + /// The List Domain Services in Subscription operation lists all the domain + /// services available under the given subscription (and across all resource + /// groups within that subscription). + /// + /// + /// Headers that will be added to request. + /// + /// + /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AAD/domainServices").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + 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")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List Domain Services in Resource Group + /// + /// + /// The List Domain Services in Resource Group operation lists all the domain + /// services available under the given resource group. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Headers that will be added to request. + /// + /// + /// 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 (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AAD/domainServices").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + 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")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or Update Domain Service (PUT Resource) + /// + /// + /// The Create Domain Service operation creates a new domain service with the + /// specified parameters. If the specific service already exists, then any + /// patchable properties will be updated and any immutable properties will + /// remain unchanged. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Create or Update a Domain Service operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string domainServiceName, DomainService domainService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, domainServiceName, domainService, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Domain Service + /// + /// + /// The Get Domain Service operation retrieves a json representation of the + /// Domain Service. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// 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 domainServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (domainServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainServiceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("domainServiceName", domainServiceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AAD/domainServices/{domainServiceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{domainServiceName}", System.Uri.EscapeDataString(domainServiceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + 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")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete Domain Service (DELETE Resource) + /// + /// + /// The Delete Domain Service operation deletes an existing Domain Service. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string domainServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, domainServiceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update Domain Service (PATCH Resource) + /// + /// + /// The Update Domain Service operation can be used to update the existing + /// deployment. The update call only supports the properties listed in the + /// PATCH body. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Update a Domain Service operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string domainServiceName, DomainService domainService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, domainServiceName, domainService, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or Update Domain Service (PUT Resource) + /// + /// + /// The Create Domain Service operation creates a new domain service with the + /// specified parameters. If the specific service already exists, then any + /// patchable properties will be updated and any immutable properties will + /// remain unchanged. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Create or Update a Domain Service operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string domainServiceName, DomainService domainService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (domainServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainServiceName"); + } + if (domainService == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainService"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("domainServiceName", domainServiceName); + tracingParameters.Add("domainService", domainService); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AAD/domainServices/{domainServiceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{domainServiceName}", System.Uri.EscapeDataString(domainServiceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(domainService != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainService, 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 (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + 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")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete Domain Service (DELETE Resource) + /// + /// + /// The Delete Domain Service operation deletes an existing Domain Service. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// 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 domainServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (domainServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainServiceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("domainServiceName", domainServiceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AAD/domainServices/{domainServiceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{domainServiceName}", System.Uri.EscapeDataString(domainServiceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + 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")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update Domain Service (PATCH Resource) + /// + /// + /// The Update Domain Service operation can be used to update the existing + /// deployment. The update call only supports the properties listed in the + /// PATCH body. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Update a Domain Service operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string domainServiceName, DomainService domainService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (domainServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainServiceName"); + } + if (domainService == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainService"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("domainServiceName", domainServiceName); + tracingParameters.Add("domainService", domainService); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AAD/domainServices/{domainServiceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{domainServiceName}", System.Uri.EscapeDataString(domainServiceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(domainService != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainService, 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 (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + 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")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List Domain Services in Subscription + /// + /// + /// The List Domain Services in Subscription operation lists all the domain + /// services available under the given subscription (and across all resource + /// groups within that subscription). + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + 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")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List Domain Services in Resource Group + /// + /// + /// The List Domain Services in Resource Group operation lists all the domain + /// services available under the given resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + 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")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServicesOperationsExtensions.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServicesOperationsExtensions.cs new file mode 100644 index 000000000000..fb795254d204 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServicesOperationsExtensions.cs @@ -0,0 +1,569 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DomainServicesOperations. + /// + public static partial class DomainServicesOperationsExtensions + { + /// + /// List Domain Services in Subscription + /// + /// + /// The List Domain Services in Subscription operation lists all the domain + /// services available under the given subscription (and across all resource + /// groups within that subscription). + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IDomainServicesOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// List Domain Services in Subscription + /// + /// + /// The List Domain Services in Subscription operation lists all the domain + /// services available under the given subscription (and across all resource + /// groups within that subscription). + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IDomainServicesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List Domain Services in Resource Group + /// + /// + /// The List Domain Services in Resource Group operation lists all the domain + /// services available under the given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + public static IPage ListByResourceGroup(this IDomainServicesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// List Domain Services in Resource Group + /// + /// + /// The List Domain Services in Resource Group operation lists all the domain + /// services available under the given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IDomainServicesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or Update Domain Service (PUT Resource) + /// + /// + /// The Create Domain Service operation creates a new domain service with the + /// specified parameters. If the specific service already exists, then any + /// patchable properties will be updated and any immutable properties will + /// remain unchanged. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Create or Update a Domain Service operation. + /// + public static DomainService CreateOrUpdate(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName, DomainService domainService) + { + return operations.CreateOrUpdateAsync(resourceGroupName, domainServiceName, domainService).GetAwaiter().GetResult(); + } + + /// + /// Create or Update Domain Service (PUT Resource) + /// + /// + /// The Create Domain Service operation creates a new domain service with the + /// specified parameters. If the specific service already exists, then any + /// patchable properties will be updated and any immutable properties will + /// remain unchanged. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Create or Update a Domain Service operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName, DomainService domainService, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, domainServiceName, domainService, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get Domain Service + /// + /// + /// The Get Domain Service operation retrieves a json representation of the + /// Domain Service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + public static DomainService Get(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName) + { + return operations.GetAsync(resourceGroupName, domainServiceName).GetAwaiter().GetResult(); + } + + /// + /// Get Domain Service + /// + /// + /// The Get Domain Service operation retrieves a json representation of the + /// Domain Service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, domainServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete Domain Service (DELETE Resource) + /// + /// + /// The Delete Domain Service operation deletes an existing Domain Service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + public static void Delete(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName) + { + operations.DeleteAsync(resourceGroupName, domainServiceName).GetAwaiter().GetResult(); + } + + /// + /// Delete Domain Service (DELETE Resource) + /// + /// + /// The Delete Domain Service operation deletes an existing Domain Service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, domainServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Update Domain Service (PATCH Resource) + /// + /// + /// The Update Domain Service operation can be used to update the existing + /// deployment. The update call only supports the properties listed in the + /// PATCH body. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Update a Domain Service operation. + /// + public static DomainService Update(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName, DomainService domainService) + { + return operations.UpdateAsync(resourceGroupName, domainServiceName, domainService).GetAwaiter().GetResult(); + } + + /// + /// Update Domain Service (PATCH Resource) + /// + /// + /// The Update Domain Service operation can be used to update the existing + /// deployment. The update call only supports the properties listed in the + /// PATCH body. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Update a Domain Service operation. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName, DomainService domainService, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, domainServiceName, domainService, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or Update Domain Service (PUT Resource) + /// + /// + /// The Create Domain Service operation creates a new domain service with the + /// specified parameters. If the specific service already exists, then any + /// patchable properties will be updated and any immutable properties will + /// remain unchanged. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Create or Update a Domain Service operation. + /// + public static DomainService BeginCreateOrUpdate(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName, DomainService domainService) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, domainServiceName, domainService).GetAwaiter().GetResult(); + } + + /// + /// Create or Update Domain Service (PUT Resource) + /// + /// + /// The Create Domain Service operation creates a new domain service with the + /// specified parameters. If the specific service already exists, then any + /// patchable properties will be updated and any immutable properties will + /// remain unchanged. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Create or Update a Domain Service operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName, DomainService domainService, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, domainServiceName, domainService, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete Domain Service (DELETE Resource) + /// + /// + /// The Delete Domain Service operation deletes an existing Domain Service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + public static void BeginDelete(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName) + { + operations.BeginDeleteAsync(resourceGroupName, domainServiceName).GetAwaiter().GetResult(); + } + + /// + /// Delete Domain Service (DELETE Resource) + /// + /// + /// The Delete Domain Service operation deletes an existing Domain Service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, domainServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Update Domain Service (PATCH Resource) + /// + /// + /// The Update Domain Service operation can be used to update the existing + /// deployment. The update call only supports the properties listed in the + /// PATCH body. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Update a Domain Service operation. + /// + public static DomainService BeginUpdate(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName, DomainService domainService) + { + return operations.BeginUpdateAsync(resourceGroupName, domainServiceName, domainService).GetAwaiter().GetResult(); + } + + /// + /// Update Domain Service (PATCH Resource) + /// + /// + /// The Update Domain Service operation can be used to update the existing + /// deployment. The update call only supports the properties listed in the + /// PATCH body. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Update a Domain Service operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IDomainServicesOperations operations, string resourceGroupName, string domainServiceName, DomainService domainService, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, domainServiceName, domainService, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List Domain Services in Subscription + /// + /// + /// The List Domain Services in Subscription operation lists all the domain + /// services available under the given subscription (and across all resource + /// groups within that subscription). + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IDomainServicesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List Domain Services in Subscription + /// + /// + /// The List Domain Services in Subscription operation lists all the domain + /// services available under the given subscription (and across all resource + /// groups within that subscription). + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IDomainServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List Domain Services in Resource Group + /// + /// + /// The List Domain Services in Resource Group operation lists all the domain + /// services available under the given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IDomainServicesOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List Domain Services in Resource Group + /// + /// + /// The List Domain Services in Resource Group operation lists all the domain + /// services available under the given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IDomainServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServicesResourceProviderClient.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServicesResourceProviderClient.cs new file mode 100644 index 000000000000..2952b26b1ee8 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/DomainServicesResourceProviderClient.cs @@ -0,0 +1,368 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + + /// + /// The AAD Domain Services API. + /// + public partial class DomainServicesResourceProviderClient : ServiceClient, IDomainServicesResourceProviderClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// Gets subscription credentials which uniquely identify the Microsoft Azure + /// subscription. The subscription ID forms part of the URI for every service + /// call. + /// + public string SubscriptionId { get; set; } + + /// + /// Client Api Version. + /// + public string ApiVersion { get; private set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IDomainServiceOperations. + /// + public virtual IDomainServiceOperations DomainServiceOperations { get; private set; } + + /// + /// Gets the IDomainServicesOperations. + /// + public virtual IDomainServicesOperations DomainServices { get; private set; } + + /// + /// Initializes a new instance of the DomainServicesResourceProviderClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling DomainServicesResourceProviderClient.Dispose(). False: will not dispose provided httpClient + protected DomainServicesResourceProviderClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the DomainServicesResourceProviderClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected DomainServicesResourceProviderClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the DomainServicesResourceProviderClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected DomainServicesResourceProviderClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the DomainServicesResourceProviderClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected DomainServicesResourceProviderClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the DomainServicesResourceProviderClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected DomainServicesResourceProviderClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the DomainServicesResourceProviderClient class. + /// + /// + /// 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 DomainServicesResourceProviderClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the DomainServicesResourceProviderClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling DomainServicesResourceProviderClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public DomainServicesResourceProviderClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the DomainServicesResourceProviderClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public DomainServicesResourceProviderClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the DomainServicesResourceProviderClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// 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 DomainServicesResourceProviderClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the DomainServicesResourceProviderClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public DomainServicesResourceProviderClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + DomainServiceOperations = new DomainServiceOperations(this); + DomainServices = new DomainServicesOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2017-06-01"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/IDomainServiceOperations.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/IDomainServiceOperations.cs new file mode 100644 index 000000000000..c1a765c1ee16 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/IDomainServiceOperations.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DomainServiceOperations operations. + /// + public partial interface IDomainServiceOperations + { + /// + /// Lists all the available Domain Services operations. + /// + /// + /// The headers that will be added to request. + /// + /// + /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available Domain Services operations. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// 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)); + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/IDomainServicesOperations.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/IDomainServicesOperations.cs new file mode 100644 index 000000000000..52679ba3f157 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/IDomainServicesOperations.cs @@ -0,0 +1,355 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DomainServicesOperations operations. + /// + public partial interface IDomainServicesOperations + { + /// + /// List Domain Services in Subscription + /// + /// + /// The List Domain Services in Subscription operation lists all the + /// domain services available under the given subscription (and across + /// all resource groups within that subscription). + /// + /// + /// The headers that will be added to request. + /// + /// + /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List Domain Services in Resource Group + /// + /// + /// The List Domain Services in Resource Group operation lists all the + /// domain services available under the given resource group. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// 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)); + /// + /// Create or Update Domain Service (PUT Resource) + /// + /// + /// The Create Domain Service operation creates a new domain service + /// with the specified parameters. If the specific service already + /// exists, then any patchable properties will be updated and any + /// immutable properties will remain unchanged. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Create or Update a Domain Service + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// 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 domainServiceName, DomainService domainService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get Domain Service + /// + /// + /// The Get Domain Service operation retrieves a json representation of + /// the Domain Service. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// 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 domainServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete Domain Service (DELETE Resource) + /// + /// + /// The Delete Domain Service operation deletes an existing Domain + /// Service. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string domainServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update Domain Service (PATCH Resource) + /// + /// + /// The Update Domain Service operation can be used to update the + /// existing deployment. The update call only supports the properties + /// listed in the PATCH body. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Update a Domain Service operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string domainServiceName, DomainService domainService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or Update Domain Service (PUT Resource) + /// + /// + /// The Create Domain Service operation creates a new domain service + /// with the specified parameters. If the specific service already + /// exists, then any patchable properties will be updated and any + /// immutable properties will remain unchanged. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Create or Update a Domain Service + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string domainServiceName, DomainService domainService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete Domain Service (DELETE Resource) + /// + /// + /// The Delete Domain Service operation deletes an existing Domain + /// Service. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string domainServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update Domain Service (PATCH Resource) + /// + /// + /// The Update Domain Service operation can be used to update the + /// existing deployment. The update call only supports the properties + /// listed in the PATCH body. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The name of the domain service. + /// + /// + /// Properties supplied to the Update a Domain Service operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string domainServiceName, DomainService domainService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List Domain Services in Subscription + /// + /// + /// The List Domain Services in Subscription operation lists all the + /// domain services available under the given subscription (and across + /// all resource groups within that subscription). + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// 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)); + /// + /// List Domain Services in Resource Group + /// + /// + /// The List Domain Services in Resource Group operation lists all the + /// domain services available under the given resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// 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/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/IDomainServicesResourceProviderClient.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/IDomainServicesResourceProviderClient.cs new file mode 100644 index 000000000000..b6a2a1ad16d1 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/IDomainServicesResourceProviderClient.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// The AAD Domain Services API. + /// + public partial interface IDomainServicesResourceProviderClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// Gets subscription credentials which uniquely identify the Microsoft + /// Azure subscription. The subscription ID forms part of the URI for + /// every service call. + /// + string SubscriptionId { get; set; } + + /// + /// Client Api Version. + /// + string ApiVersion { get; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IDomainServiceOperations. + /// + IDomainServiceOperations DomainServiceOperations { get; } + + /// + /// Gets the IDomainServicesOperations. + /// + IDomainServicesOperations DomainServices { get; } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/DomainSecuritySettings.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/DomainSecuritySettings.cs new file mode 100644 index 000000000000..ff671a34ed86 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/DomainSecuritySettings.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Domain Security Settings + /// + public partial class DomainSecuritySettings + { + /// + /// Initializes a new instance of the DomainSecuritySettings class. + /// + public DomainSecuritySettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DomainSecuritySettings class. + /// + /// A flag to determine whether or not NtlmV1 is + /// enabled or disabled. Possible values include: 'Enabled', + /// 'Disabled' + /// A flag to determine whether or not TlsV1 is + /// enabled or disabled. Possible values include: 'Enabled', + /// 'Disabled' + /// A flag to determine whether or not + /// SyncNtlmPasswords is enabled or disabled. Possible values include: + /// 'Enabled', 'Disabled' + public DomainSecuritySettings(string ntlmV1 = default(string), string tlsV1 = default(string), string syncNtlmPasswords = default(string)) + { + NtlmV1 = ntlmV1; + TlsV1 = tlsV1; + SyncNtlmPasswords = syncNtlmPasswords; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a flag to determine whether or not NtlmV1 is enabled + /// or disabled. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "ntlmV1")] + public string NtlmV1 { get; set; } + + /// + /// Gets or sets a flag to determine whether or not TlsV1 is enabled or + /// disabled. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "tlsV1")] + public string TlsV1 { get; set; } + + /// + /// Gets or sets a flag to determine whether or not SyncNtlmPasswords + /// is enabled or disabled. Possible values include: 'Enabled', + /// 'Disabled' + /// + [JsonProperty(PropertyName = "syncNtlmPasswords")] + public string SyncNtlmPasswords { get; set; } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/DomainService.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/DomainService.cs new file mode 100644 index 000000000000..32717930d27b --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/DomainService.cs @@ -0,0 +1,183 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Domain service. + /// + [Rest.Serialization.JsonTransformation] + public partial class DomainService : Resource + { + /// + /// Initializes a new instance of the DomainService class. + /// + public DomainService() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DomainService class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// Resource location + /// Resource tags + /// Resource etag + /// Azure Active Directory tenant id + /// The name of the Azure domain that the user + /// would like to deploy Domain Services to. + /// Virtual network site id + /// The name of the virtual network that Domain + /// Services will be deployed on. The id of the subnet that Domain + /// Services will be deployed on. + /// /virtualNetwork/vnetName/subnets/subnetName. + /// Secure LDAP Settings + /// Last domain evaluation run + /// DateTime + /// List of Domain Health Monitors + /// List of Domain Health Alerts + /// Notification Settings + /// DomainSecurity + /// Settings + /// Enabled or Disabled flag to turn on + /// Group-based filtered sync. Possible values include: 'Enabled', + /// 'Disabled' + /// List of Domain Controller + /// IP Address + /// Status of Domain Service + /// instance + /// the current deployment or + /// provisioning state, which only appears in the response. + public DomainService(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string), string tenantId = default(string), string domainName = default(string), string vnetSiteId = default(string), string subnetId = default(string), LdapsSettings ldapsSettings = default(LdapsSettings), System.DateTime? healthLastEvaluated = default(System.DateTime?), IList healthMonitors = default(IList), IList healthAlerts = default(IList), NotificationSettings notificationSettings = default(NotificationSettings), DomainSecuritySettings domainSecuritySettings = default(DomainSecuritySettings), string filteredSync = default(string), IList domainControllerIpAddress = default(IList), string serviceStatus = default(string), string provisioningState = default(string)) + : base(id, name, type, location, tags, etag) + { + TenantId = tenantId; + DomainName = domainName; + VnetSiteId = vnetSiteId; + SubnetId = subnetId; + LdapsSettings = ldapsSettings; + HealthLastEvaluated = healthLastEvaluated; + HealthMonitors = healthMonitors; + HealthAlerts = healthAlerts; + NotificationSettings = notificationSettings; + DomainSecuritySettings = domainSecuritySettings; + FilteredSync = filteredSync; + DomainControllerIpAddress = domainControllerIpAddress; + ServiceStatus = serviceStatus; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets azure Active Directory tenant id + /// + [JsonProperty(PropertyName = "properties.tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets the name of the Azure domain that the user would like + /// to deploy Domain Services to. + /// + [JsonProperty(PropertyName = "properties.domainName")] + public string DomainName { get; set; } + + /// + /// Gets virtual network site id + /// + [JsonProperty(PropertyName = "properties.vnetSiteId")] + public string VnetSiteId { get; private set; } + + /// + /// Gets or sets the name of the virtual network that Domain Services + /// will be deployed on. The id of the subnet that Domain Services will + /// be deployed on. /virtualNetwork/vnetName/subnets/subnetName. + /// + [JsonProperty(PropertyName = "properties.subnetId")] + public string SubnetId { get; set; } + + /// + /// Gets or sets secure LDAP Settings + /// + [JsonProperty(PropertyName = "properties.ldapsSettings")] + public LdapsSettings LdapsSettings { get; set; } + + /// + /// Gets last domain evaluation run DateTime + /// + [JsonProperty(PropertyName = "properties.healthLastEvaluated")] + public System.DateTime? HealthLastEvaluated { get; private set; } + + /// + /// Gets list of Domain Health Monitors + /// + [JsonProperty(PropertyName = "properties.healthMonitors")] + public IList HealthMonitors { get; private set; } + + /// + /// Gets list of Domain Health Alerts + /// + [JsonProperty(PropertyName = "properties.healthAlerts")] + public IList HealthAlerts { get; private set; } + + /// + /// Gets or sets notification Settings + /// + [JsonProperty(PropertyName = "properties.notificationSettings")] + public NotificationSettings NotificationSettings { get; set; } + + /// + /// Gets or sets domainSecurity Settings + /// + [JsonProperty(PropertyName = "properties.domainSecuritySettings")] + public DomainSecuritySettings DomainSecuritySettings { get; set; } + + /// + /// Gets or sets enabled or Disabled flag to turn on Group-based + /// filtered sync. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.filteredSync")] + public string FilteredSync { get; set; } + + /// + /// Gets list of Domain Controller IP Address + /// + [JsonProperty(PropertyName = "properties.domainControllerIpAddress")] + public IList DomainControllerIpAddress { get; private set; } + + /// + /// Gets status of Domain Service instance + /// + [JsonProperty(PropertyName = "properties.serviceStatus")] + public string ServiceStatus { get; private set; } + + /// + /// Gets the current deployment or provisioning state, which only + /// appears in the response. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/ExternalAccess.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/ExternalAccess.cs new file mode 100644 index 000000000000..20f4287baf00 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/ExternalAccess.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + + /// + /// Defines values for ExternalAccess. + /// + public static class ExternalAccess + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/FilteredSync.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/FilteredSync.cs new file mode 100644 index 000000000000..0f651e5be034 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/FilteredSync.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + + /// + /// Defines values for FilteredSync. + /// + public static class FilteredSync + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/HealthAlert.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/HealthAlert.cs new file mode 100644 index 000000000000..8be2c8d5f9d5 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/HealthAlert.cs @@ -0,0 +1,100 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Health Alert Description + /// + public partial class HealthAlert + { + /// + /// Initializes a new instance of the HealthAlert class. + /// + public HealthAlert() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HealthAlert class. + /// + /// Health Alert Id + /// Health Alert Name + /// Health Alert Issue + /// Health Alert Severity + /// Health Alert Raised DateTime + /// Health Alert Last Detected + /// DateTime + /// Health Alert TSG Link + public HealthAlert(string id = default(string), string name = default(string), string issue = default(string), string severity = default(string), System.DateTime? raised = default(System.DateTime?), System.DateTime? lastDetected = default(System.DateTime?), string resolutionUri = default(string)) + { + Id = id; + Name = name; + Issue = issue; + Severity = severity; + Raised = raised; + LastDetected = lastDetected; + ResolutionUri = resolutionUri; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets health Alert Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets health Alert Name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets health Alert Issue + /// + [JsonProperty(PropertyName = "issue")] + public string Issue { get; private set; } + + /// + /// Gets health Alert Severity + /// + [JsonProperty(PropertyName = "severity")] + public string Severity { get; private set; } + + /// + /// Gets health Alert Raised DateTime + /// + [JsonProperty(PropertyName = "raised")] + public System.DateTime? Raised { get; private set; } + + /// + /// Gets health Alert Last Detected DateTime + /// + [JsonProperty(PropertyName = "lastDetected")] + public System.DateTime? LastDetected { get; private set; } + + /// + /// Gets health Alert TSG Link + /// + [JsonProperty(PropertyName = "resolutionUri")] + public string ResolutionUri { get; private set; } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/HealthMonitor.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/HealthMonitor.cs new file mode 100644 index 000000000000..526d5803d4c0 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/HealthMonitor.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Health Monitor Description + /// + public partial class HealthMonitor + { + /// + /// Initializes a new instance of the HealthMonitor class. + /// + public HealthMonitor() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HealthMonitor class. + /// + /// Health Monitor Id + /// Health Monitor Name + /// Health Monitor Details + public HealthMonitor(string id = default(string), string name = default(string), string details = default(string)) + { + Id = id; + Name = name; + Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets health Monitor Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets health Monitor Name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets health Monitor Details + /// + [JsonProperty(PropertyName = "details")] + public string Details { get; private set; } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/Ldaps.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/Ldaps.cs new file mode 100644 index 000000000000..a04dcf14f770 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/Ldaps.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + + /// + /// Defines values for Ldaps. + /// + public static class Ldaps + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/LdapsSettings.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/LdapsSettings.cs new file mode 100644 index 000000000000..28b064276958 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/LdapsSettings.cs @@ -0,0 +1,124 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Secure LDAP Settings + /// + public partial class LdapsSettings + { + /// + /// Initializes a new instance of the LdapsSettings class. + /// + public LdapsSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LdapsSettings class. + /// + /// A flag to determine whether or not Secure LDAP + /// is enabled or disabled. Possible values include: 'Enabled', + /// 'Disabled' + /// The certificate required to configure + /// Secure LDAP. The parameter passed here should be a base64encoded + /// representation of the certificate pfx file. + /// The password to decrypt the + /// provided Secure LDAP certificate pfx file. + /// Public certificate used to + /// configure secure ldap. + /// Thumbprint of configure ldaps + /// certificate. + /// NotAfter DateTime of configure + /// ldaps certificate. + /// A flag to determine whether or not + /// Secure LDAP access over the internet is enabled or disabled. + /// Possible values include: 'Enabled', 'Disabled' + /// External access ip + /// address. + public LdapsSettings(string ldaps = default(string), string pfxCertificate = default(string), string pfxCertificatePassword = default(string), string publicCertificate = default(string), string certificateThumbprint = default(string), System.DateTime? certificateNotAfter = default(System.DateTime?), string externalAccess = default(string), string externalAccessIpAddress = default(string)) + { + Ldaps = ldaps; + PfxCertificate = pfxCertificate; + PfxCertificatePassword = pfxCertificatePassword; + PublicCertificate = publicCertificate; + CertificateThumbprint = certificateThumbprint; + CertificateNotAfter = certificateNotAfter; + ExternalAccess = externalAccess; + ExternalAccessIpAddress = externalAccessIpAddress; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a flag to determine whether or not Secure LDAP is + /// enabled or disabled. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "ldaps")] + public string Ldaps { get; set; } + + /// + /// Gets or sets the certificate required to configure Secure LDAP. The + /// parameter passed here should be a base64encoded representation of + /// the certificate pfx file. + /// + [JsonProperty(PropertyName = "pfxCertificate")] + public string PfxCertificate { get; set; } + + /// + /// Gets or sets the password to decrypt the provided Secure LDAP + /// certificate pfx file. + /// + [JsonProperty(PropertyName = "pfxCertificatePassword")] + public string PfxCertificatePassword { get; set; } + + /// + /// Gets public certificate used to configure secure ldap. + /// + [JsonProperty(PropertyName = "publicCertificate")] + public string PublicCertificate { get; private set; } + + /// + /// Gets thumbprint of configure ldaps certificate. + /// + [JsonProperty(PropertyName = "certificateThumbprint")] + public string CertificateThumbprint { get; private set; } + + /// + /// Gets notAfter DateTime of configure ldaps certificate. + /// + [JsonProperty(PropertyName = "certificateNotAfter")] + public System.DateTime? CertificateNotAfter { get; private set; } + + /// + /// Gets or sets a flag to determine whether or not Secure LDAP access + /// over the internet is enabled or disabled. Possible values include: + /// 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "externalAccess")] + public string ExternalAccess { get; set; } + + /// + /// Gets external access ip address. + /// + [JsonProperty(PropertyName = "externalAccessIpAddress")] + public string ExternalAccessIpAddress { get; private set; } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NotificationSettings.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NotificationSettings.cs new file mode 100644 index 000000000000..0018b9bcbaf7 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NotificationSettings.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Settings for notification + /// + public partial class NotificationSettings + { + /// + /// Initializes a new instance of the NotificationSettings class. + /// + public NotificationSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotificationSettings class. + /// + /// Should global admins be notified. + /// Possible values include: 'Enabled', 'Disabled' + /// Should domain controller admins be + /// notified. Possible values include: 'Enabled', 'Disabled' + /// The list of additional + /// recipients + public NotificationSettings(string notifyGlobalAdmins = default(string), string notifyDcAdmins = default(string), IList additionalRecipients = default(IList)) + { + NotifyGlobalAdmins = notifyGlobalAdmins; + NotifyDcAdmins = notifyDcAdmins; + AdditionalRecipients = additionalRecipients; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets should global admins be notified. Possible values + /// include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "notifyGlobalAdmins")] + public string NotifyGlobalAdmins { get; set; } + + /// + /// Gets or sets should domain controller admins be notified. Possible + /// values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "notifyDcAdmins")] + public string NotifyDcAdmins { get; set; } + + /// + /// Gets or sets the list of additional recipients + /// + [JsonProperty(PropertyName = "additionalRecipients")] + public IList AdditionalRecipients { get; set; } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NotifyDcAdmins.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NotifyDcAdmins.cs new file mode 100644 index 000000000000..79eefaa83953 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NotifyDcAdmins.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + + /// + /// Defines values for NotifyDcAdmins. + /// + public static class NotifyDcAdmins + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NotifyGlobalAdmins.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NotifyGlobalAdmins.cs new file mode 100644 index 000000000000..57c058ead3c5 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NotifyGlobalAdmins.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + + /// + /// Defines values for NotifyGlobalAdmins. + /// + public static class NotifyGlobalAdmins + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NtlmV1.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NtlmV1.cs new file mode 100644 index 000000000000..2f935b494035 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/NtlmV1.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + + /// + /// Defines values for NtlmV1. + /// + public static class NtlmV1 + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/OperationDisplayInfo.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/OperationDisplayInfo.cs new file mode 100644 index 000000000000..7a3477caf34c --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/OperationDisplayInfo.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The operation supported by Domain Services. + /// + public partial class OperationDisplayInfo + { + /// + /// Initializes a new instance of the OperationDisplayInfo class. + /// + public OperationDisplayInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplayInfo class. + /// + /// The description of the operation. + /// The action that users can perform, based on + /// their permission level. + /// Service provider: Domain Services. + /// Resource on which the operation is + /// performed. + public OperationDisplayInfo(string description = default(string), string operation = default(string), string provider = default(string), string resource = default(string)) + { + Description = description; + Operation = operation; + Provider = provider; + Resource = resource; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the description of the operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the action that users can perform, based on their + /// permission level. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets service provider: Domain Services. + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets resource on which the operation is performed. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/OperationEntity.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/OperationEntity.cs new file mode 100644 index 000000000000..9994c824a7ba --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/OperationEntity.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The operation supported by Domain Services. + /// + public partial class OperationEntity + { + /// + /// Initializes a new instance of the OperationEntity class. + /// + public OperationEntity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationEntity class. + /// + /// Operation name: + /// {provider}/{resource}/{operation}. + /// The operation supported by Domain + /// Services. + /// The origin of the operation. + public OperationEntity(string name = default(string), OperationDisplayInfo display = default(OperationDisplayInfo), string origin = default(string)) + { + Name = name; + Display = display; + Origin = origin; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets operation name: {provider}/{resource}/{operation}. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the operation supported by Domain Services. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplayInfo Display { get; set; } + + /// + /// Gets or sets the origin of the operation. + /// + [JsonProperty(PropertyName = "origin")] + public string Origin { get; set; } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/Page.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/Page.cs new file mode 100644 index 000000000000..d7f14afe3837 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/Page.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator 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. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/Resource.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/Resource.cs new file mode 100644 index 000000000000..d6190dc03b40 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/Resource.cs @@ -0,0 +1,95 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The Resource model definition. + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// Resource location + /// Resource tags + /// Resource etag + public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets resource location + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets resource etag + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } + + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/SyncNtlmPasswords.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/SyncNtlmPasswords.cs new file mode 100644 index 000000000000..ec007ab3b1f7 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/SyncNtlmPasswords.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + + /// + /// Defines values for SyncNtlmPasswords. + /// + public static class SyncNtlmPasswords + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/TlsV1.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/TlsV1.cs new file mode 100644 index 000000000000..dce60da17199 --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/Models/TlsV1.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DomainServices.Models +{ + + /// + /// Defines values for TlsV1. + /// + public static class TlsV1 + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/SdkInfo_DomainServicesResourceProvider.cs b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/SdkInfo_DomainServicesResourceProvider.cs new file mode 100644 index 000000000000..0f7c71d631dc --- /dev/null +++ b/sdk/domainservices/Microsoft.Azure.Management.DomainServices/src/Generated/SdkInfo_DomainServicesResourceProvider.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.DomainServices +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_DomainServicesResourceProvider + { + get + { + return new Tuple[] + { + new Tuple("AAD", "DomainServiceOperations", "2017-06-01"), + new Tuple("AAD", "DomainServices", "2017-06-01"), + }.AsEnumerable(); + } + } + } +}