diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClient.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClient.cs new file mode 100644 index 0000000000000..aeb31201c45b5 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClient.cs @@ -0,0 +1,770 @@ +// +// 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.MachineLearningServices +{ + 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; + using System.Threading; + using System.Threading.Tasks; + + /// + /// These APIs allow end users to operate on Azure Machine Learning + /// Workspace resources. + /// + public partial class AzureMachineLearningWorkspacesClient : ServiceClient, IAzureMachineLearningWorkspacesClient, 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; } + + /// + /// Azure subscription identifier. + /// + public string SubscriptionId { get; set; } + + /// + /// Version of Azure Machine Learning resource provider API. + /// + 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 IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IWorkspacesOperations. + /// + public virtual IWorkspacesOperations Workspaces { get; private set; } + + /// + /// Gets the IWorkspaceFeaturesOperations. + /// + public virtual IWorkspaceFeaturesOperations WorkspaceFeatures { get; private set; } + + /// + /// Gets the INotebooksOperations. + /// + public virtual INotebooksOperations Notebooks { get; private set; } + + /// + /// Gets the IUsagesOperations. + /// + public virtual IUsagesOperations Usages { get; private set; } + + /// + /// Gets the IVirtualMachineSizesOperations. + /// + public virtual IVirtualMachineSizesOperations VirtualMachineSizes { get; private set; } + + /// + /// Gets the IQuotasOperations. + /// + public virtual IQuotasOperations Quotas { get; private set; } + + /// + /// Gets the IWorkspaceConnectionsOperations. + /// + public virtual IWorkspaceConnectionsOperations WorkspaceConnections { get; private set; } + + /// + /// Gets the IMachineLearningComputeOperations. + /// + public virtual IMachineLearningComputeOperations MachineLearningCompute { get; private set; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureMachineLearningWorkspacesClient.Dispose(). False: will not dispose provided httpClient + protected AzureMachineLearningWorkspacesClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected AzureMachineLearningWorkspacesClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected AzureMachineLearningWorkspacesClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient 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 AzureMachineLearningWorkspacesClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient 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 AzureMachineLearningWorkspacesClient(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 AzureMachineLearningWorkspacesClient 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 AzureMachineLearningWorkspacesClient(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 AzureMachineLearningWorkspacesClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureMachineLearningWorkspacesClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public AzureMachineLearningWorkspacesClient(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 AzureMachineLearningWorkspacesClient 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 AzureMachineLearningWorkspacesClient(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 AzureMachineLearningWorkspacesClient 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 AzureMachineLearningWorkspacesClient(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 AzureMachineLearningWorkspacesClient 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 AzureMachineLearningWorkspacesClient(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() + { + Operations = new Operations(this); + Workspaces = new WorkspacesOperations(this); + WorkspaceFeatures = new WorkspaceFeaturesOperations(this); + Notebooks = new NotebooksOperations(this); + Usages = new UsagesOperations(this); + VirtualMachineSizes = new VirtualMachineSizesOperations(this); + Quotas = new QuotasOperations(this); + WorkspaceConnections = new WorkspaceConnectionsOperations(this); + MachineLearningCompute = new MachineLearningComputeOperations(this); + PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); + PrivateLinkResources = new PrivateLinkResourcesOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2020-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() + } + }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("computeType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("computeType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("computeType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("computeType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("computeType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("computeType")); + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + /// + /// Lists all skus with associated features + /// + /// + /// 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>> ListSkusWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.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, "ListSkus", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces/skus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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 = SafeJsonConvert.DeserializeObject>(_responseContent, 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 skus with associated features + /// + /// + /// 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>> ListSkusNextWithHttpMessagesAsync(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, "ListSkusNext", 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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 = SafeJsonConvert.DeserializeObject>(_responseContent, 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClientExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClientExtensions.cs new file mode 100644 index 0000000000000..0aa5b14300e72 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClientExtensions.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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for AzureMachineLearningWorkspacesClient. + /// + public static partial class AzureMachineLearningWorkspacesClientExtensions + { + /// + /// Lists all skus with associated features + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListSkus(this IAzureMachineLearningWorkspacesClient operations) + { + return operations.ListSkusAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all skus with associated features + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListSkusAsync(this IAzureMachineLearningWorkspacesClient operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSkusWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all skus with associated features + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListSkusNext(this IAzureMachineLearningWorkspacesClient operations, string nextPageLink) + { + return operations.ListSkusNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all skus with associated features + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListSkusNextAsync(this IAzureMachineLearningWorkspacesClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSkusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IAzureMachineLearningWorkspacesClient.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IAzureMachineLearningWorkspacesClient.cs new file mode 100644 index 0000000000000..1d58818070061 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IAzureMachineLearningWorkspacesClient.cs @@ -0,0 +1,158 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// These APIs allow end users to operate on Azure Machine Learning + /// Workspace resources. + /// + public partial interface IAzureMachineLearningWorkspacesClient : 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; } + + /// + /// Azure subscription identifier. + /// + string SubscriptionId { get; set; } + + /// + /// Version of Azure Machine Learning resource provider API. + /// + 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 IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the IWorkspacesOperations. + /// + IWorkspacesOperations Workspaces { get; } + + /// + /// Gets the IWorkspaceFeaturesOperations. + /// + IWorkspaceFeaturesOperations WorkspaceFeatures { get; } + + /// + /// Gets the INotebooksOperations. + /// + INotebooksOperations Notebooks { get; } + + /// + /// Gets the IUsagesOperations. + /// + IUsagesOperations Usages { get; } + + /// + /// Gets the IVirtualMachineSizesOperations. + /// + IVirtualMachineSizesOperations VirtualMachineSizes { get; } + + /// + /// Gets the IQuotasOperations. + /// + IQuotasOperations Quotas { get; } + + /// + /// Gets the IWorkspaceConnectionsOperations. + /// + IWorkspaceConnectionsOperations WorkspaceConnections { get; } + + /// + /// Gets the IMachineLearningComputeOperations. + /// + IMachineLearningComputeOperations MachineLearningCompute { get; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + IPrivateLinkResourcesOperations PrivateLinkResources { get; } + + /// + /// Lists all skus with associated features + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListSkusWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists all skus with associated features + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListSkusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IMachineLearningComputeOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IMachineLearningComputeOperations.cs new file mode 100644 index 0000000000000..0d61831d39da2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IMachineLearningComputeOperations.cs @@ -0,0 +1,432 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MachineLearningComputeOperations operations. + /// + public partial interface IMachineLearningComputeOperations + { + /// + /// Gets computes in specified workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Continuation token for pagination. + /// + /// + /// 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>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets compute definition by its name. Any secrets (storage keys, + /// service credentials, etc) are not returned - use 'keys' nested + /// resource to get them. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// 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 workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates compute. This call will overwrite a compute if + /// it exists. This is a nonrecoverable operation. If your intent is to + /// create a new compute, do a GET first to verify that it does not + /// exist yet. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + /// + /// 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 workspaceName, string computeName, ComputeResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates properties of a compute. This call will overwrite a compute + /// if it exists. This is a nonrecoverable operation. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + /// + /// 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 workspaceName, string computeName, ClusterUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying + /// compute from workspace if 'Detach'. Possible values include: + /// 'Delete', 'Detach' + /// + /// + /// 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 workspaceName, string computeName, string underlyingResourceAction, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the details (e.g IP address, port etc) of all the compute nodes + /// in the compute. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// 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> ListNodesWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets secrets related to Machine Learning compute (storage keys, + /// service credentials, etc). + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// 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> ListKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Posts a start action to a compute instance + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// 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 StartWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Posts a stop action to a compute instance + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// 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 StopWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Posts a restart action to a compute instance + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// 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 RestartWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates compute. This call will overwrite a compute if + /// it exists. This is a nonrecoverable operation. If your intent is to + /// create a new compute, do a GET first to verify that it does not + /// exist yet. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + /// + /// 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 workspaceName, string computeName, ComputeResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates properties of a compute. This call will overwrite a compute + /// if it exists. This is a nonrecoverable operation. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + /// + /// 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 workspaceName, string computeName, ClusterUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying + /// compute from workspace if 'Detach'. Possible values include: + /// 'Delete', 'Detach' + /// + /// + /// 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 workspaceName, string computeName, string underlyingResourceAction, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets computes in specified workspace. + /// + /// + /// 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>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/INotebooksOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/INotebooksOperations.cs new file mode 100644 index 0000000000000..de758f24f9157 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/INotebooksOperations.cs @@ -0,0 +1,71 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NotebooksOperations operations. + /// + public partial interface INotebooksOperations + { + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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> PrepareWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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> BeginPrepareWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IOperations.cs new file mode 100644 index 0000000000000..ff0615daf4769 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IOperations.cs @@ -0,0 +1,47 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available Azure Machine Learning Workspaces REST + /// API 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)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateEndpointConnectionsOperations.cs new file mode 100644 index 0000000000000..be8400648f875 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -0,0 +1,144 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + public partial interface IPrivateEndpointConnectionsOperations + { + /// + /// Gets the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the + /// workspace + /// + /// + /// 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 workspaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the state of specified private endpoint connection + /// associated with the workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the + /// workspace + /// + /// + /// The private endpoint connection properties. + /// + /// + /// 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> PutWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string privateEndpointConnectionName, PrivateEndpointConnection properties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified private endpoint connection associated with + /// the workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the + /// workspace + /// + /// + /// 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 workspaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified private endpoint connection associated with + /// the workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the + /// workspace + /// + /// + /// 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 workspaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateLinkResourcesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateLinkResourcesOperations.cs new file mode 100644 index 0000000000000..084ed9f9238bb --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateLinkResourcesOperations.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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateLinkResourcesOperations operations. + /// + public partial interface IPrivateLinkResourcesOperations + { + /// + /// Gets the private link resources that need to be created for a + /// workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IQuotasOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IQuotasOperations.cs new file mode 100644 index 0000000000000..0380e47ac2019 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IQuotasOperations.cs @@ -0,0 +1,96 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// QuotasOperations operations. + /// + public partial interface IQuotasOperations + { + /// + /// Update quota for each VM family in workspace. + /// + /// + /// The location for update quota is queried. + /// + /// + /// Quota update parameters. + /// + /// + /// 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 location, QuotaUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// 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(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IUsagesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IUsagesOperations.cs new file mode 100644 index 0000000000000..6864e81d92e6f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IUsagesOperations.cs @@ -0,0 +1,73 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// UsagesOperations operations. + /// + public partial interface IUsagesOperations + { + /// + /// Gets the current usage information as well as limits for AML + /// resources for given subscription and location. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// 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(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the current usage information as well as limits for AML + /// resources for given subscription and location. + /// + /// + /// 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IVirtualMachineSizesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IVirtualMachineSizesOperations.cs new file mode 100644 index 0000000000000..08c5562882ffd --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IVirtualMachineSizesOperations.cs @@ -0,0 +1,49 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// VirtualMachineSizesOperations operations. + /// + public partial interface IVirtualMachineSizesOperations + { + /// + /// Returns supported VM Sizes in a location + /// + /// + /// The location upon which virtual-machine-sizes is queried. + /// + /// + /// 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(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceConnectionsOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceConnectionsOperations.cs new file mode 100644 index 0000000000000..2309664bb3e17 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceConnectionsOperations.cs @@ -0,0 +1,142 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspaceConnectionsOperations operations. + /// + public partial interface IWorkspaceConnectionsOperations + { + /// + /// List all connections under a AML workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Target of the workspace connection. + /// + /// + /// Category of the workspace connection. + /// + /// + /// 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(string resourceGroupName, string workspaceName, string target = default(string), string category = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Add a new workspace connection. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The object for creating or updating a new workspace connection + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string connectionName, WorkspaceConnectionDto parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the detail of a workspace connection. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// 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 workspaceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a workspace connection. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// 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 workspaceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceFeaturesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceFeaturesOperations.cs new file mode 100644 index 0000000000000..2eacab3a4dd44 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceFeaturesOperations.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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspaceFeaturesOperations operations. + /// + public partial interface IWorkspaceFeaturesOperations + { + /// + /// Lists all enabled features for a workspace + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all enabled features for a workspace + /// + /// + /// 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspacesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspacesOperations.cs new file mode 100644 index 0000000000000..3cf65a84182f1 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspacesOperations.cs @@ -0,0 +1,328 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspacesOperations operations. + /// + public partial interface IWorkspacesOperations + { + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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 workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning + /// workspace. + /// + /// + /// 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 workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a machine learning workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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 workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for updating a machine learning workspace. + /// + /// + /// 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 workspaceName, WorkspaceUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified resource group. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Continuation token for pagination. + /// + /// + /// 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, string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the keys associated with this workspace. This includes + /// keys for the storage account, app insights and password for + /// container registry + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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> ListKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Resync all the keys associated with this workspace. This includes + /// keys for the storage account, app insights and password for + /// container registry + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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 ResyncKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified subscription. + /// + /// + /// Continuation token for pagination. + /// + /// + /// 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>> ListBySubscriptionWithHttpMessagesAsync(string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning + /// workspace. + /// + /// + /// 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 workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a machine learning workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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 workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified 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)); + /// + /// Lists all the available machine learning workspaces under the + /// specified 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperations.cs new file mode 100644 index 0000000000000..54e74936b64d3 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperations.cs @@ -0,0 +1,2321 @@ +// +// 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.MachineLearningServices +{ + 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; + + /// + /// MachineLearningComputeOperations operations. + /// + internal partial class MachineLearningComputeOperations : IServiceOperations, IMachineLearningComputeOperations + { + /// + /// Initializes a new instance of the MachineLearningComputeOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal MachineLearningComputeOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Gets computes in specified workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Continuation token for pagination. + /// + /// + /// 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>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("skiptoken", skiptoken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", 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.MachineLearningServices/workspaces/{workspaceName}/computes").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Gets compute definition by its name. Any secrets (storage keys, service + /// credentials, etc) are not returned - use 'keys' nested resource to get + /// them. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// 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 workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + 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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates properties of a compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying compute + /// from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the details (e.g IP address, port etc) of all the compute nodes in the + /// compute. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// 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> ListNodesWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNodes", 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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + 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("POST"); + _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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Gets secrets related to Machine Learning compute (storage keys, service + /// credentials, etc). + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// 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> ListKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListKeys", 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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + 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("POST"); + _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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Posts a start action to a compute instance + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// 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 StartWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Start", 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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + 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("POST"); + _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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Posts a stop action to a compute instance + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// 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 StopWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Stop", 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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + 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("POST"); + _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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Posts a restart action to a compute instance + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// 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 RestartWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Restart", 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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + 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("POST"); + _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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + /// + /// 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 workspaceName, string computeName, ComputeResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("parameters", parameters); + 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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + 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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates properties of a compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + /// + /// 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 workspaceName, string computeName, ClusterUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("parameters", parameters); + 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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + 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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying compute + /// from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' + /// + /// + /// 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 workspaceName, string computeName, string underlyingResourceAction, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (underlyingResourceAction == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "underlyingResourceAction"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("underlyingResourceAction", underlyingResourceAction); + 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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (underlyingResourceAction != null) + { + _queryParameters.Add(string.Format("underlyingResourceAction={0}", System.Uri.EscapeDataString(underlyingResourceAction))); + } + 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 != 200 && (int)_statusCode != 202) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets computes in specified workspace. + /// + /// + /// 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>> ListByWorkspaceNextWithHttpMessagesAsync(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, "ListByWorkspaceNext", 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperationsExtensions.cs new file mode 100644 index 0000000000000..be32ad5d97bac --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperationsExtensions.cs @@ -0,0 +1,708 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for MachineLearningComputeOperations. + /// + public static partial class MachineLearningComputeOperationsExtensions + { + /// + /// Gets computes in specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Continuation token for pagination. + /// + public static IPage ListByWorkspace(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string skiptoken = default(string)) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName, skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Gets computes in specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Continuation token for pagination. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets compute definition by its name. Any secrets (storage keys, service + /// credentials, etc) are not returned - use 'keys' nested resource to get + /// them. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static ComputeResource Get(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + return operations.GetAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Gets compute definition by its name. Any secrets (storage keys, service + /// credentials, etc) are not returned - use 'keys' nested resource to get + /// them. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + public static ComputeResource CreateOrUpdate(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates properties of a compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + public static ComputeResource Update(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, computeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates properties of a compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying compute + /// from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' + /// + public static MachineLearningComputeDeleteHeaders Delete(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction) + { + return operations.DeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction).GetAwaiter().GetResult(); + } + + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying compute + /// from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// Get the details (e.g IP address, port etc) of all the compute nodes in the + /// compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static AmlComputeNodesInformation ListNodes(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + return operations.ListNodesAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Get the details (e.g IP address, port etc) of all the compute nodes in the + /// compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task ListNodesAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNodesWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets secrets related to Machine Learning compute (storage keys, service + /// credentials, etc). + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static ComputeSecrets ListKeys(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + return operations.ListKeysAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Gets secrets related to Machine Learning compute (storage keys, service + /// credentials, etc). + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task ListKeysAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Posts a start action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static void Start(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + operations.StartAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Posts a start action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task StartAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.StartWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Posts a stop action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static void Stop(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + operations.StopAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Posts a stop action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task StopAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.StopWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Posts a restart action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static void Restart(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + operations.RestartAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Posts a restart action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task RestartAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RestartWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + public static ComputeResource BeginCreateOrUpdate(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates properties of a compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + public static ComputeResource BeginUpdate(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, workspaceName, computeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates properties of a compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying compute + /// from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' + /// + public static MachineLearningComputeDeleteHeaders BeginDelete(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction) + { + return operations.BeginDeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction).GetAwaiter().GetResult(); + } + + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying compute + /// from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// Gets computes in specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByWorkspaceNext(this IMachineLearningComputeOperations operations, string nextPageLink) + { + return operations.ListByWorkspaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets computes in specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceNextAsync(this IMachineLearningComputeOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKS.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKS.cs new file mode 100644 index 0000000000000..a498f1aaf39d9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKS.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A Machine Learning compute based on AKS. + /// + public partial class AKS : Compute + { + /// + /// Initializes a new instance of the AKS class. + /// + public AKS() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AKS class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + /// AKS properties + public AKS(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), AKSProperties properties = default(AKSProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets AKS properties + /// + [JsonProperty(PropertyName = "properties")] + public AKSProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKSProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKSProperties.cs new file mode 100644 index 0000000000000..0db36a5166297 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKSProperties.cs @@ -0,0 +1,113 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AKS properties + /// + public partial class AKSProperties + { + /// + /// Initializes a new instance of the AKSProperties class. + /// + public AKSProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AKSProperties class. + /// + /// Cluster full qualified domain + /// name + /// System services + /// Number of agents + /// Agent virtual machine size + /// SSL configuration + /// AKS networking + /// configuration for vnet + public AKSProperties(string clusterFqdn = default(string), IList systemServices = default(IList), int? agentCount = default(int?), string agentVMSize = default(string), SslConfiguration sslConfiguration = default(SslConfiguration), AksNetworkingConfiguration aksNetworkingConfiguration = default(AksNetworkingConfiguration)) + { + ClusterFqdn = clusterFqdn; + SystemServices = systemServices; + AgentCount = agentCount; + AgentVMSize = agentVMSize; + SslConfiguration = sslConfiguration; + AksNetworkingConfiguration = aksNetworkingConfiguration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets cluster full qualified domain name + /// + [JsonProperty(PropertyName = "clusterFqdn")] + public string ClusterFqdn { get; set; } + + /// + /// Gets system services + /// + [JsonProperty(PropertyName = "systemServices")] + public IList SystemServices { get; private set; } + + /// + /// Gets or sets number of agents + /// + [JsonProperty(PropertyName = "agentCount")] + public int? AgentCount { get; set; } + + /// + /// Gets or sets agent virtual machine size + /// + [JsonProperty(PropertyName = "agentVMSize")] + public string AgentVMSize { get; set; } + + /// + /// Gets or sets SSL configuration + /// + [JsonProperty(PropertyName = "sslConfiguration")] + public SslConfiguration SslConfiguration { get; set; } + + /// + /// Gets or sets AKS networking configuration for vnet + /// + [JsonProperty(PropertyName = "aksNetworkingConfiguration")] + public AksNetworkingConfiguration AksNetworkingConfiguration { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AgentCount < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "AgentCount", 1); + } + if (AksNetworkingConfiguration != null) + { + AksNetworkingConfiguration.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksComputeSecrets.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksComputeSecrets.cs new file mode 100644 index 0000000000000..928dc31c00143 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksComputeSecrets.cs @@ -0,0 +1,73 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Secrets related to a Machine Learning compute based on AKS. + /// + [Newtonsoft.Json.JsonObject("AKS")] + public partial class AksComputeSecrets : ComputeSecrets + { + /// + /// Initializes a new instance of the AksComputeSecrets class. + /// + public AksComputeSecrets() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AksComputeSecrets class. + /// + /// Content of kubeconfig file that can be + /// used to connect to the Kubernetes cluster. + /// Content of kubeconfig file that can + /// be used to connect to the Kubernetes cluster. + /// Image registry pull + /// secret. + public AksComputeSecrets(string userKubeConfig = default(string), string adminKubeConfig = default(string), string imagePullSecretName = default(string)) + { + UserKubeConfig = userKubeConfig; + AdminKubeConfig = adminKubeConfig; + ImagePullSecretName = imagePullSecretName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets content of kubeconfig file that can be used to connect + /// to the Kubernetes cluster. + /// + [JsonProperty(PropertyName = "userKubeConfig")] + public string UserKubeConfig { get; set; } + + /// + /// Gets or sets content of kubeconfig file that can be used to connect + /// to the Kubernetes cluster. + /// + [JsonProperty(PropertyName = "adminKubeConfig")] + public string AdminKubeConfig { get; set; } + + /// + /// Gets or sets image registry pull secret. + /// + [JsonProperty(PropertyName = "imagePullSecretName")] + public string ImagePullSecretName { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksNetworkingConfiguration.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksNetworkingConfiguration.cs new file mode 100644 index 0000000000000..0bf64b74556d8 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksNetworkingConfiguration.cs @@ -0,0 +1,119 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Advance configuration for AKS networking + /// + public partial class AksNetworkingConfiguration + { + /// + /// Initializes a new instance of the AksNetworkingConfiguration class. + /// + public AksNetworkingConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AksNetworkingConfiguration class. + /// + /// Virtual network subnet resource ID the + /// compute nodes belong to + /// A CIDR notation IP range from which to + /// assign service cluster IPs. It must not overlap with any Subnet IP + /// ranges. + /// An IP address assigned to the Kubernetes + /// DNS service. It must be within the Kubernetes service address range + /// specified in serviceCidr. + /// A CIDR notation IP range assigned to + /// the Docker bridge network. It must not overlap with any Subnet IP + /// ranges or the Kubernetes service address range. + public AksNetworkingConfiguration(string subnetId = default(string), string serviceCidr = default(string), string dnsServiceIP = default(string), string dockerBridgeCidr = default(string)) + { + SubnetId = subnetId; + ServiceCidr = serviceCidr; + DnsServiceIP = dnsServiceIP; + DockerBridgeCidr = dockerBridgeCidr; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual network subnet resource ID the compute nodes + /// belong to + /// + [JsonProperty(PropertyName = "subnetId")] + public string SubnetId { get; set; } + + /// + /// Gets or sets a CIDR notation IP range from which to assign service + /// cluster IPs. It must not overlap with any Subnet IP ranges. + /// + [JsonProperty(PropertyName = "serviceCidr")] + public string ServiceCidr { get; set; } + + /// + /// Gets or sets an IP address assigned to the Kubernetes DNS service. + /// It must be within the Kubernetes service address range specified in + /// serviceCidr. + /// + [JsonProperty(PropertyName = "dnsServiceIP")] + public string DnsServiceIP { get; set; } + + /// + /// Gets or sets a CIDR notation IP range assigned to the Docker bridge + /// network. It must not overlap with any Subnet IP ranges or the + /// Kubernetes service address range. + /// + [JsonProperty(PropertyName = "dockerBridgeCidr")] + public string DockerBridgeCidr { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ServiceCidr != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(ServiceCidr, "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$")) + { + throw new ValidationException(ValidationRules.Pattern, "ServiceCidr", "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$"); + } + } + if (DnsServiceIP != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(DnsServiceIP, "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")) + { + throw new ValidationException(ValidationRules.Pattern, "DnsServiceIP", "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"); + } + } + if (DockerBridgeCidr != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(DockerBridgeCidr, "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$")) + { + throw new ValidationException(ValidationRules.Pattern, "DockerBridgeCidr", "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$"); + } + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AllocationState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AllocationState.cs new file mode 100644 index 0000000000000..87578396374d2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AllocationState.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.MachineLearningServices.Models +{ + + /// + /// Defines values for AllocationState. + /// + public static class AllocationState + { + public const string Steady = "Steady"; + public const string Resizing = "Resizing"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlCompute.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlCompute.cs new file mode 100644 index 0000000000000..f8261c04e2d6a --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlCompute.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Azure Machine Learning compute. + /// + public partial class AmlCompute : Compute + { + /// + /// Initializes a new instance of the AmlCompute class. + /// + public AmlCompute() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmlCompute class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + /// AML Compute properties + public AmlCompute(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), AmlComputeProperties properties = default(AmlComputeProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets AML Compute properties + /// + [JsonProperty(PropertyName = "properties")] + public AmlComputeProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodeInformation.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodeInformation.cs new file mode 100644 index 0000000000000..56dafcdf7fbff --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodeInformation.cs @@ -0,0 +1,112 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Compute node information related to a AmlCompute. + /// + public partial class AmlComputeNodeInformation + { + /// + /// Initializes a new instance of the AmlComputeNodeInformation class. + /// + public AmlComputeNodeInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmlComputeNodeInformation class. + /// + /// Node ID. + /// Private IP address. + /// Public IP address. + /// Port. + /// State of the compute node. Values are idle, + /// running, preparing, unusable, leaving and preempted. Possible + /// values include: 'idle', 'running', 'preparing', 'unusable', + /// 'leaving', 'preempted' + /// Run ID. + public AmlComputeNodeInformation(string nodeId = default(string), string privateIpAddress = default(string), string publicIpAddress = default(string), double? port = default(double?), string nodeState = default(string), string runId = default(string)) + { + NodeId = nodeId; + PrivateIpAddress = privateIpAddress; + PublicIpAddress = publicIpAddress; + Port = port; + NodeState = nodeState; + RunId = runId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets node ID. + /// + /// + /// ID of the compute node. + /// + [JsonProperty(PropertyName = "nodeId")] + public string NodeId { get; private set; } + + /// + /// Gets private IP address. + /// + /// + /// Private IP address of the compute node. + /// + [JsonProperty(PropertyName = "privateIpAddress")] + public string PrivateIpAddress { get; private set; } + + /// + /// Gets public IP address. + /// + /// + /// Public IP address of the compute node. + /// + [JsonProperty(PropertyName = "publicIpAddress")] + public string PublicIpAddress { get; private set; } + + /// + /// Gets port. + /// + /// + /// SSH port number of the node. + /// + [JsonProperty(PropertyName = "port")] + public double? Port { get; private set; } + + /// + /// Gets state of the compute node. Values are idle, running, + /// preparing, unusable, leaving and preempted. Possible values + /// include: 'idle', 'running', 'preparing', 'unusable', 'leaving', + /// 'preempted' + /// + [JsonProperty(PropertyName = "nodeState")] + public string NodeState { get; private set; } + + /// + /// Gets run ID. + /// + /// + /// ID of the Experiment running on the node, if any else null. + /// + [JsonProperty(PropertyName = "runId")] + public string RunId { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodesInformation.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodesInformation.cs new file mode 100644 index 0000000000000..cb871da65c045 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodesInformation.cs @@ -0,0 +1,57 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Compute node information related to a AmlCompute. + /// + [Newtonsoft.Json.JsonObject("AmlCompute")] + public partial class AmlComputeNodesInformation : ComputeNodesInformation + { + /// + /// Initializes a new instance of the AmlComputeNodesInformation class. + /// + public AmlComputeNodesInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmlComputeNodesInformation class. + /// + /// The continuation token. + /// The collection of returned AmlCompute nodes + /// details. + public AmlComputeNodesInformation(string nextLink = default(string), IList nodes = default(IList)) + : base(nextLink) + { + Nodes = nodes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the collection of returned AmlCompute nodes details. + /// + [JsonProperty(PropertyName = "nodes")] + public IList Nodes { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeProperties.cs new file mode 100644 index 0000000000000..b4035da498ec2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeProperties.cs @@ -0,0 +1,215 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AML Compute properties + /// + public partial class AmlComputeProperties + { + /// + /// Initializes a new instance of the AmlComputeProperties class. + /// + public AmlComputeProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmlComputeProperties class. + /// + /// Virtual Machine Size + /// Virtual Machine priority. Possible values + /// include: 'Dedicated', 'LowPriority' + /// Scale settings for AML Compute + /// User account + /// credentials. + /// Subnet. + /// Close remote Login Access + /// Port + /// Allocation state. + /// Allocation state + /// transition time. + /// Errors. + /// Current node count. + /// Target node count. + /// Node state counts. + public AmlComputeProperties(string vmSize = default(string), string vmPriority = default(string), ScaleSettings scaleSettings = default(ScaleSettings), UserAccountCredentials userAccountCredentials = default(UserAccountCredentials), ResourceId subnet = default(ResourceId), string remoteLoginPortPublicAccess = default(string), string allocationState = default(string), System.DateTime? allocationStateTransitionTime = default(System.DateTime?), IList errors = default(IList), int? currentNodeCount = default(int?), int? targetNodeCount = default(int?), NodeStateCounts nodeStateCounts = default(NodeStateCounts)) + { + VmSize = vmSize; + VmPriority = vmPriority; + ScaleSettings = scaleSettings; + UserAccountCredentials = userAccountCredentials; + Subnet = subnet; + RemoteLoginPortPublicAccess = remoteLoginPortPublicAccess; + AllocationState = allocationState; + AllocationStateTransitionTime = allocationStateTransitionTime; + Errors = errors; + CurrentNodeCount = currentNodeCount; + TargetNodeCount = targetNodeCount; + NodeStateCounts = nodeStateCounts; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual Machine Size + /// + [JsonProperty(PropertyName = "vmSize")] + public string VmSize { get; set; } + + /// + /// Gets or sets virtual Machine priority. Possible values include: + /// 'Dedicated', 'LowPriority' + /// + [JsonProperty(PropertyName = "vmPriority")] + public string VmPriority { get; set; } + + /// + /// Gets or sets scale settings for AML Compute + /// + [JsonProperty(PropertyName = "scaleSettings")] + public ScaleSettings ScaleSettings { get; set; } + + /// + /// Gets or sets user account credentials. + /// + /// + /// Credentials for an administrator user account that will be created + /// on each compute node. + /// + [JsonProperty(PropertyName = "userAccountCredentials")] + public UserAccountCredentials UserAccountCredentials { get; set; } + + /// + /// Gets or sets subnet. + /// + /// + /// Virtual network subnet resource ID the compute nodes belong to. + /// + [JsonProperty(PropertyName = "subnet")] + public ResourceId Subnet { get; set; } + + /// + /// Gets or sets close remote Login Access Port + /// + /// + /// State of the public SSH port. Possible values are: Disabled - + /// Indicates that the public ssh port is closed on all nodes of the + /// cluster. Enabled - Indicates that the public ssh port is open on + /// all nodes of the cluster. NotSpecified - Indicates that the public + /// ssh port is closed on all nodes of the cluster if VNet is defined, + /// else is open all public nodes. It can be default only during + /// cluster creation time, after creation it will be either enabled or + /// disabled. Possible values include: 'Enabled', 'Disabled', + /// 'NotSpecified' + /// + [JsonProperty(PropertyName = "remoteLoginPortPublicAccess")] + public string RemoteLoginPortPublicAccess { get; set; } + + /// + /// Gets allocation state. + /// + /// + /// Allocation state of the compute. Possible values are: steady - + /// Indicates that the compute is not resizing. There are no changes to + /// the number of compute nodes in the compute in progress. A compute + /// enters this state when it is created and when no operations are + /// being performed on the compute to change the number of compute + /// nodes. resizing - Indicates that the compute is resizing; that is, + /// compute nodes are being added to or removed from the compute. + /// Possible values include: 'Steady', 'Resizing' + /// + [JsonProperty(PropertyName = "allocationState")] + public string AllocationState { get; private set; } + + /// + /// Gets allocation state transition time. + /// + /// + /// The time at which the compute entered its current allocation state. + /// + [JsonProperty(PropertyName = "allocationStateTransitionTime")] + public System.DateTime? AllocationStateTransitionTime { get; private set; } + + /// + /// Gets errors. + /// + /// + /// Collection of errors encountered by various compute nodes during + /// node setup. + /// + [JsonProperty(PropertyName = "errors")] + public IList Errors { get; private set; } + + /// + /// Gets current node count. + /// + /// + /// The number of compute nodes currently assigned to the compute. + /// + [JsonProperty(PropertyName = "currentNodeCount")] + public int? CurrentNodeCount { get; private set; } + + /// + /// Gets target node count. + /// + /// + /// The target number of compute nodes for the compute. If the + /// allocationState is resizing, this property denotes the target node + /// count for the ongoing resize operation. If the allocationState is + /// steady, this property denotes the target node count for the + /// previous resize operation. + /// + [JsonProperty(PropertyName = "targetNodeCount")] + public int? TargetNodeCount { get; private set; } + + /// + /// Gets node state counts. + /// + /// + /// Counts of various node states on the compute. + /// + [JsonProperty(PropertyName = "nodeStateCounts")] + public NodeStateCounts NodeStateCounts { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ScaleSettings != null) + { + ScaleSettings.Validate(); + } + if (UserAccountCredentials != null) + { + UserAccountCredentials.Validate(); + } + if (Subnet != null) + { + Subnet.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlUserFeature.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlUserFeature.cs new file mode 100644 index 0000000000000..e22d752edf7a0 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlUserFeature.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Features enabled for a workspace + /// + public partial class AmlUserFeature + { + /// + /// Initializes a new instance of the AmlUserFeature class. + /// + public AmlUserFeature() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmlUserFeature class. + /// + /// Specifies the feature ID + /// Specifies the feature name + /// Describes the feature for user + /// experience + public AmlUserFeature(string id = default(string), string displayName = default(string), string description = default(string)) + { + Id = id; + DisplayName = displayName; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the feature ID + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets specifies the feature name + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets describes the feature for user experience + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ApplicationSharingPolicy.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ApplicationSharingPolicy.cs new file mode 100644 index 0000000000000..2e090b18400e2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ApplicationSharingPolicy.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.MachineLearningServices.Models +{ + + /// + /// Defines values for ApplicationSharingPolicy. + /// + public static class ApplicationSharingPolicy + { + public const string Personal = "Personal"; + public const string Shared = "Shared"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ClusterUpdateParameters.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ClusterUpdateParameters.cs new file mode 100644 index 0000000000000..9087828997a05 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ClusterUpdateParameters.cs @@ -0,0 +1,70 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// AmlCompute update parameters. + /// + [Rest.Serialization.JsonTransformation] + public partial class ClusterUpdateParameters + { + /// + /// Initializes a new instance of the ClusterUpdateParameters class. + /// + public ClusterUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClusterUpdateParameters class. + /// + /// Scale settings. + public ClusterUpdateParameters(ScaleSettings scaleSettings = default(ScaleSettings)) + { + ScaleSettings = scaleSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets scale settings. + /// + /// + /// Desired scale settings for the amlCompute. + /// + [JsonProperty(PropertyName = "properties.scaleSettings")] + public ScaleSettings ScaleSettings { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ScaleSettings != null) + { + ScaleSettings.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Compute.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Compute.cs new file mode 100644 index 0000000000000..bbd04c93f6708 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Compute.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Machine Learning compute object. + /// + public partial class Compute + { + /// + /// Initializes a new instance of the Compute class. + /// + public Compute() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Compute class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + public Compute(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?)) + { + ComputeLocation = computeLocation; + ProvisioningState = provisioningState; + Description = description; + CreatedOn = createdOn; + ModifiedOn = modifiedOn; + ResourceId = resourceId; + ProvisioningErrors = provisioningErrors; + IsAttachedCompute = isAttachedCompute; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets location for the underlying compute + /// + [JsonProperty(PropertyName = "computeLocation")] + public string ComputeLocation { get; set; } + + /// + /// Gets the provision state of the cluster. Valid values are Unknown, + /// Updating, Provisioning, Succeeded, and Failed. Possible values + /// include: 'Unknown', 'Updating', 'Creating', 'Deleting', + /// 'Succeeded', 'Failed', 'Canceled' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the description of the Machine Learning compute. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets the date and time when the compute was created. + /// + [JsonProperty(PropertyName = "createdOn")] + public System.DateTime? CreatedOn { get; private set; } + + /// + /// Gets the date and time when the compute was last modified. + /// + [JsonProperty(PropertyName = "modifiedOn")] + public System.DateTime? ModifiedOn { get; private set; } + + /// + /// Gets or sets ARM resource id of the underlying compute + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets errors during provisioning + /// + [JsonProperty(PropertyName = "provisioningErrors")] + public IList ProvisioningErrors { get; private set; } + + /// + /// Gets indicating whether the compute was provisioned by user and + /// brought from outside if true, or machine learning service + /// provisioned it if false. + /// + [JsonProperty(PropertyName = "isAttachedCompute")] + public bool? IsAttachedCompute { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstance.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstance.cs new file mode 100644 index 0000000000000..714bd2502644c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstance.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Azure Machine Learning compute instance. + /// + public partial class ComputeInstance : Compute + { + /// + /// Initializes a new instance of the ComputeInstance class. + /// + public ComputeInstance() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeInstance class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + /// Compute Instance properties + public ComputeInstance(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), ComputeInstanceProperties properties = default(ComputeInstanceProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets compute Instance properties + /// + [JsonProperty(PropertyName = "properties")] + public ComputeInstanceProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceApplication.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceApplication.cs new file mode 100644 index 0000000000000..be3364ccba8f6 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceApplication.cs @@ -0,0 +1,60 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines an Aml Instance application and its connectivity endpoint URI. + /// + public partial class ComputeInstanceApplication + { + /// + /// Initializes a new instance of the ComputeInstanceApplication class. + /// + public ComputeInstanceApplication() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeInstanceApplication class. + /// + /// Name of the ComputeInstance + /// application. + /// Application' endpoint URI. + public ComputeInstanceApplication(string displayName = default(string), string endpointUri = default(string)) + { + DisplayName = displayName; + EndpointUri = endpointUri; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the ComputeInstance application. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets application' endpoint URI. + /// + [JsonProperty(PropertyName = "endpointUri")] + public string EndpointUri { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceConnectivityEndpoints.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceConnectivityEndpoints.cs new file mode 100644 index 0000000000000..0bb9dd7c60d5e --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceConnectivityEndpoints.cs @@ -0,0 +1,66 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines all connectivity endpoints and properties for a + /// ComputeInstance. + /// + public partial class ComputeInstanceConnectivityEndpoints + { + /// + /// Initializes a new instance of the + /// ComputeInstanceConnectivityEndpoints class. + /// + public ComputeInstanceConnectivityEndpoints() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ComputeInstanceConnectivityEndpoints class. + /// + /// Public IP Address of this + /// ComputeInstance. + /// Private IP Address of this + /// ComputeInstance (local to the VNET in which the compute instance is + /// deployed). + public ComputeInstanceConnectivityEndpoints(string publicIpAddress = default(string), string privateIpAddress = default(string)) + { + PublicIpAddress = publicIpAddress; + PrivateIpAddress = privateIpAddress; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets public IP Address of this ComputeInstance. + /// + [JsonProperty(PropertyName = "publicIpAddress")] + public string PublicIpAddress { get; private set; } + + /// + /// Gets private IP Address of this ComputeInstance (local to the VNET + /// in which the compute instance is deployed). + /// + [JsonProperty(PropertyName = "privateIpAddress")] + public string PrivateIpAddress { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceCreatedBy.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceCreatedBy.cs new file mode 100644 index 0000000000000..859860ea27d6c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceCreatedBy.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes information on user who created this ComputeInstance. + /// + public partial class ComputeInstanceCreatedBy + { + /// + /// Initializes a new instance of the ComputeInstanceCreatedBy class. + /// + public ComputeInstanceCreatedBy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeInstanceCreatedBy class. + /// + /// Name of the user. + /// Uniquely identifies user' Azure Active + /// Directory organization. + /// Uniquely identifies the user within his/her + /// organization. + public ComputeInstanceCreatedBy(string userName = default(string), string userOrgId = default(string), string userId = default(string)) + { + UserName = userName; + UserOrgId = userOrgId; + UserId = userId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the user. + /// + [JsonProperty(PropertyName = "userName")] + public string UserName { get; private set; } + + /// + /// Gets uniquely identifies user' Azure Active Directory organization. + /// + [JsonProperty(PropertyName = "userOrgId")] + public string UserOrgId { get; private set; } + + /// + /// Gets uniquely identifies the user within his/her organization. + /// + [JsonProperty(PropertyName = "userId")] + public string UserId { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceProperties.cs new file mode 100644 index 0000000000000..b0498f6f0fb1d --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceProperties.cs @@ -0,0 +1,160 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Compute Instance properties + /// + public partial class ComputeInstanceProperties + { + /// + /// Initializes a new instance of the ComputeInstanceProperties class. + /// + public ComputeInstanceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeInstanceProperties class. + /// + /// Virtual Machine Size + /// Subnet. + /// Sharing policy for + /// applications on this compute instance + /// Specifies policy and settings for SSH + /// access. + /// Describes all connectivity + /// endpoints available for this ComputeInstance. + /// Describes available applications and + /// their endpoints on this ComputeInstance. + /// Describes information on user who created + /// this ComputeInstance. + /// Errors. + /// The current state of this ComputeInstance. + /// Possible values include: 'Creating', 'CreateFailed', 'Deleting', + /// 'Running', 'Restarting', 'RestartFailed', 'JobRunning', + /// 'SettingUp', 'Starting', 'StartFailed', 'StopFailed', 'Stopped', + /// 'Stopping', 'UserSettingUp', 'Unknown', 'Unusable' + public ComputeInstanceProperties(string vmSize = default(string), ResourceId subnet = default(ResourceId), string applicationSharingPolicy = default(string), ComputeInstanceSshSettings sshSettings = default(ComputeInstanceSshSettings), ComputeInstanceConnectivityEndpoints connectivityEndpoints = default(ComputeInstanceConnectivityEndpoints), IList applications = default(IList), ComputeInstanceCreatedBy createdBy = default(ComputeInstanceCreatedBy), IList errors = default(IList), string state = default(string)) + { + VmSize = vmSize; + Subnet = subnet; + ApplicationSharingPolicy = applicationSharingPolicy; + SshSettings = sshSettings; + ConnectivityEndpoints = connectivityEndpoints; + Applications = applications; + CreatedBy = createdBy; + Errors = errors; + State = state; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual Machine Size + /// + [JsonProperty(PropertyName = "vmSize")] + public string VmSize { get; set; } + + /// + /// Gets or sets subnet. + /// + /// + /// Virtual network subnet resource ID the compute nodes belong to. + /// + [JsonProperty(PropertyName = "subnet")] + public ResourceId Subnet { get; set; } + + /// + /// Gets or sets sharing policy for applications on this compute + /// instance + /// + /// + /// Policy for sharing applications on this compute instance among + /// users of parent workspace. If Personal, only the creator can access + /// applications on this compute instance. When Shared, any workspace + /// user can access applications on this instance depending on his/her + /// assigned role. Possible values include: 'Personal', 'Shared' + /// + [JsonProperty(PropertyName = "applicationSharingPolicy")] + public string ApplicationSharingPolicy { get; set; } + + /// + /// Gets or sets specifies policy and settings for SSH access. + /// + [JsonProperty(PropertyName = "sshSettings")] + public ComputeInstanceSshSettings SshSettings { get; set; } + + /// + /// Gets describes all connectivity endpoints available for this + /// ComputeInstance. + /// + [JsonProperty(PropertyName = "connectivityEndpoints")] + public ComputeInstanceConnectivityEndpoints ConnectivityEndpoints { get; private set; } + + /// + /// Gets describes available applications and their endpoints on this + /// ComputeInstance. + /// + [JsonProperty(PropertyName = "applications")] + public IList Applications { get; private set; } + + /// + /// Gets describes information on user who created this + /// ComputeInstance. + /// + [JsonProperty(PropertyName = "createdBy")] + public ComputeInstanceCreatedBy CreatedBy { get; private set; } + + /// + /// Gets errors. + /// + /// + /// Collection of errors encountered on this ComputeInstance. + /// + [JsonProperty(PropertyName = "errors")] + public IList Errors { get; private set; } + + /// + /// Gets the current state of this ComputeInstance. Possible values + /// include: 'Creating', 'CreateFailed', 'Deleting', 'Running', + /// 'Restarting', 'RestartFailed', 'JobRunning', 'SettingUp', + /// 'Starting', 'StartFailed', 'StopFailed', 'Stopped', 'Stopping', + /// 'UserSettingUp', 'Unknown', 'Unusable' + /// + [JsonProperty(PropertyName = "state")] + public string State { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Subnet != null) + { + Subnet.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceSshSettings.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceSshSettings.cs new file mode 100644 index 0000000000000..f090886489401 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceSshSettings.cs @@ -0,0 +1,86 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specifies policy and settings for SSH access. + /// + public partial class ComputeInstanceSshSettings + { + /// + /// Initializes a new instance of the ComputeInstanceSshSettings class. + /// + public ComputeInstanceSshSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeInstanceSshSettings class. + /// + /// Access policy for SSH + /// Describes the admin user name. + /// Describes the port for connecting through + /// SSH. + /// Specifies the SSH rsa public key file + /// as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH + /// key pairs. + public ComputeInstanceSshSettings(string sshPublicAccess = default(string), string adminUserName = default(string), int? sshPort = default(int?), string adminPublicKey = default(string)) + { + SshPublicAccess = sshPublicAccess; + AdminUserName = adminUserName; + SshPort = sshPort; + AdminPublicKey = adminPublicKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets access policy for SSH + /// + /// + /// State of the public SSH port. Possible values are: Disabled - + /// Indicates that the public ssh port is closed on this instance. + /// Enabled - Indicates that the public ssh port is open and accessible + /// according to the VNet/subnet policy if applicable. Possible values + /// include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "sshPublicAccess")] + public string SshPublicAccess { get; set; } + + /// + /// Gets describes the admin user name. + /// + [JsonProperty(PropertyName = "adminUserName")] + public string AdminUserName { get; private set; } + + /// + /// Gets describes the port for connecting through SSH. + /// + [JsonProperty(PropertyName = "sshPort")] + public int? SshPort { get; private set; } + + /// + /// Gets or sets specifies the SSH rsa public key file as a string. Use + /// "ssh-keygen -t rsa -b 2048" to generate your SSH key pairs. + /// + [JsonProperty(PropertyName = "adminPublicKey")] + public string AdminPublicKey { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceState.cs new file mode 100644 index 0000000000000..1b68519de1828 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceState.cs @@ -0,0 +1,36 @@ +// +// 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.MachineLearningServices.Models +{ + + /// + /// Defines values for ComputeInstanceState. + /// + public static class ComputeInstanceState + { + public const string Creating = "Creating"; + public const string CreateFailed = "CreateFailed"; + public const string Deleting = "Deleting"; + public const string Running = "Running"; + public const string Restarting = "Restarting"; + public const string RestartFailed = "RestartFailed"; + public const string JobRunning = "JobRunning"; + public const string SettingUp = "SettingUp"; + public const string Starting = "Starting"; + public const string StartFailed = "StartFailed"; + public const string StopFailed = "StopFailed"; + public const string Stopped = "Stopped"; + public const string Stopping = "Stopping"; + public const string UserSettingUp = "UserSettingUp"; + public const string Unknown = "Unknown"; + public const string Unusable = "Unusable"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeNodesInformation.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeNodesInformation.cs new file mode 100644 index 0000000000000..f7e33347d2b92 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeNodesInformation.cs @@ -0,0 +1,52 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Compute nodes information related to a Machine Learning compute. Might + /// differ for every type of compute. + /// + public partial class ComputeNodesInformation + { + /// + /// Initializes a new instance of the ComputeNodesInformation class. + /// + public ComputeNodesInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeNodesInformation class. + /// + /// The continuation token. + public ComputeNodesInformation(string nextLink = default(string)) + { + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the continuation token. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeResource.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeResource.cs new file mode 100644 index 0000000000000..dfa161a0c39bf --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeResource.cs @@ -0,0 +1,73 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Machine Learning compute object wrapped into ARM resource envelope. + /// + public partial class ComputeResource : Resource + { + /// + /// Initializes a new instance of the ComputeResource class. + /// + public ComputeResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeResource class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + /// Compute properties + public ComputeResource(string id = default(string), string name = default(string), Identity identity = default(Identity), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Compute properties = default(Compute)) + : base(id, name, identity, location, type, tags, sku) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets compute properties + /// + [JsonProperty(PropertyName = "properties")] + public Compute Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeSecrets.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeSecrets.cs new file mode 100644 index 0000000000000..5c33a82a7a802 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeSecrets.cs @@ -0,0 +1,36 @@ +// +// 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.MachineLearningServices.Models +{ + using System.Linq; + + /// + /// Secrets related to a Machine Learning compute. Might differ for every + /// type of compute. + /// + public partial class ComputeSecrets + { + /// + /// Initializes a new instance of the ComputeSecrets class. + /// + public ComputeSecrets() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeType.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeType.cs new file mode 100644 index 0000000000000..6f08bd5a7debf --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeType.cs @@ -0,0 +1,28 @@ +// +// 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.MachineLearningServices.Models +{ + + /// + /// Defines values for ComputeType. + /// + public static class ComputeType + { + public const string AKS = "AKS"; + public const string AmlCompute = "AmlCompute"; + public const string ComputeInstance = "ComputeInstance"; + public const string DataFactory = "DataFactory"; + public const string VirtualMachine = "VirtualMachine"; + public const string HDInsight = "HDInsight"; + public const string Databricks = "Databricks"; + public const string DataLakeAnalytics = "DataLakeAnalytics"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataFactory.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataFactory.cs new file mode 100644 index 0000000000000..07978c82d41e0 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataFactory.cs @@ -0,0 +1,63 @@ +// +// 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.MachineLearningServices.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A DataFactory compute. + /// + public partial class DataFactory : Compute + { + /// + /// Initializes a new instance of the DataFactory class. + /// + public DataFactory() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFactory class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + public DataFactory(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalytics.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalytics.cs new file mode 100644 index 0000000000000..0b3987211ac0e --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalytics.cs @@ -0,0 +1,70 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A DataLakeAnalytics compute. + /// + public partial class DataLakeAnalytics : Compute + { + /// + /// Initializes a new instance of the DataLakeAnalytics class. + /// + public DataLakeAnalytics() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataLakeAnalytics class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + public DataLakeAnalytics(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), DataLakeAnalyticsProperties properties = default(DataLakeAnalyticsProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public DataLakeAnalyticsProperties Properties { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalyticsProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalyticsProperties.cs new file mode 100644 index 0000000000000..fa9841e8f2233 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalyticsProperties.cs @@ -0,0 +1,51 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class DataLakeAnalyticsProperties + { + /// + /// Initializes a new instance of the DataLakeAnalyticsProperties + /// class. + /// + public DataLakeAnalyticsProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataLakeAnalyticsProperties + /// class. + /// + /// DataLake Store Account + /// Name + public DataLakeAnalyticsProperties(string dataLakeStoreAccountName = default(string)) + { + DataLakeStoreAccountName = dataLakeStoreAccountName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets dataLake Store Account Name + /// + [JsonProperty(PropertyName = "dataLakeStoreAccountName")] + public string DataLakeStoreAccountName { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Databricks.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Databricks.cs new file mode 100644 index 0000000000000..43c7fceb36324 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Databricks.cs @@ -0,0 +1,70 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A DataFactory compute. + /// + public partial class Databricks : Compute + { + /// + /// Initializes a new instance of the Databricks class. + /// + public Databricks() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Databricks class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + public Databricks(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), DatabricksProperties properties = default(DatabricksProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public DatabricksProperties Properties { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksComputeSecrets.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksComputeSecrets.cs new file mode 100644 index 0000000000000..6b859c12da66b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksComputeSecrets.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Secrets related to a Machine Learning compute based on Databricks. + /// + [Newtonsoft.Json.JsonObject("Databricks")] + public partial class DatabricksComputeSecrets : ComputeSecrets + { + /// + /// Initializes a new instance of the DatabricksComputeSecrets class. + /// + public DatabricksComputeSecrets() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DatabricksComputeSecrets class. + /// + /// access token for databricks + /// account. + public DatabricksComputeSecrets(string databricksAccessToken = default(string)) + { + DatabricksAccessToken = databricksAccessToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets access token for databricks account. + /// + [JsonProperty(PropertyName = "databricksAccessToken")] + public string DatabricksAccessToken { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksProperties.cs new file mode 100644 index 0000000000000..85ed6aabf3022 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksProperties.cs @@ -0,0 +1,48 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class DatabricksProperties + { + /// + /// Initializes a new instance of the DatabricksProperties class. + /// + public DatabricksProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DatabricksProperties class. + /// + /// Databricks access token + public DatabricksProperties(string databricksAccessToken = default(string)) + { + DatabricksAccessToken = databricksAccessToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets databricks access token + /// + [JsonProperty(PropertyName = "databricksAccessToken")] + public string DatabricksAccessToken { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionProperty.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionProperty.cs new file mode 100644 index 0000000000000..8fa71945ea0e4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionProperty.cs @@ -0,0 +1,82 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + public partial class EncryptionProperty + { + /// + /// Initializes a new instance of the EncryptionProperty class. + /// + public EncryptionProperty() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EncryptionProperty class. + /// + /// Indicates whether or not the encryption is + /// enabled for the workspace. Possible values include: 'Enabled', + /// 'Disabled' + /// Customer Key vault + /// properties. + public EncryptionProperty(string status, KeyVaultProperties keyVaultProperties) + { + Status = status; + KeyVaultProperties = keyVaultProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates whether or not the encryption is enabled for + /// the workspace. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets customer Key vault properties. + /// + [JsonProperty(PropertyName = "keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Status == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + } + if (KeyVaultProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KeyVaultProperties"); + } + if (KeyVaultProperties != null) + { + KeyVaultProperties.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionStatus.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionStatus.cs new file mode 100644 index 0000000000000..b57375b90fe33 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionStatus.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.MachineLearningServices.Models +{ + + /// + /// Defines values for EncryptionStatus. + /// + public static class EncryptionStatus + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorDetail.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 0000000000000..2bf9e2ad96357 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorDetail.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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error detail information. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// Error code. + /// Error message. + public ErrorDetail(string code, string message) + { + Code = code; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Code == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Code"); + } + if (Message == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Message"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorResponse.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorResponse.cs new file mode 100644 index 0000000000000..5f922bad08780 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorResponse.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Error response information. + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// Error code. + /// Error message. + /// An array of error detail objects. + public ErrorResponse(string code = default(string), string message = default(string), IList details = default(IList)) + { + Code = code; + Message = message; + Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets an array of error detail objects. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsight.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsight.cs new file mode 100644 index 0000000000000..1a9b77dd90524 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsight.cs @@ -0,0 +1,70 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A HDInsight compute. + /// + public partial class HDInsight : Compute + { + /// + /// Initializes a new instance of the HDInsight class. + /// + public HDInsight() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HDInsight class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + public HDInsight(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), HDInsightProperties properties = default(HDInsightProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public HDInsightProperties Properties { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsightProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsightProperties.cs new file mode 100644 index 0000000000000..a50ec018664e4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsightProperties.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class HDInsightProperties + { + /// + /// Initializes a new instance of the HDInsightProperties class. + /// + public HDInsightProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HDInsightProperties class. + /// + /// Port open for ssh connections on the master + /// node of the cluster. + /// Public IP address of the master node of the + /// cluster. + /// Admin credentials for master + /// node of the cluster + public HDInsightProperties(int? sshPort = default(int?), string address = default(string), VirtualMachineSshCredentials administratorAccount = default(VirtualMachineSshCredentials)) + { + SshPort = sshPort; + Address = address; + AdministratorAccount = administratorAccount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets port open for ssh connections on the master node of + /// the cluster. + /// + [JsonProperty(PropertyName = "sshPort")] + public int? SshPort { get; set; } + + /// + /// Gets or sets public IP address of the master node of the cluster. + /// + [JsonProperty(PropertyName = "address")] + public string Address { get; set; } + + /// + /// Gets or sets admin credentials for master node of the cluster + /// + [JsonProperty(PropertyName = "administratorAccount")] + public VirtualMachineSshCredentials AdministratorAccount { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Identity.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Identity.cs new file mode 100644 index 0000000000000..def9d296cabbb --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Identity.cs @@ -0,0 +1,97 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Identity for the resource. + /// + public partial class Identity + { + /// + /// Initializes a new instance of the Identity class. + /// + public Identity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Identity class. + /// + /// The identity type. Possible values include: + /// 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned', + /// 'None' + /// The principal ID of resource + /// identity. + /// The tenant ID of resource. + /// The list of user identities + /// associated with resource. The user identity dictionary key + /// references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + public Identity(ResourceIdentityType type, string principalId = default(string), string tenantId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + UserAssignedIdentities = userAssignedIdentities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal ID of resource identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the tenant ID of resource. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets the identity type. Possible values include: + /// 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned', + /// 'None' + /// + [JsonProperty(PropertyName = "type")] + public ResourceIdentityType Type { get; set; } + + /// + /// Gets or sets the list of user identities associated with resource. + /// The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/IdentityUserAssignedIdentitiesValue.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/IdentityUserAssignedIdentitiesValue.cs new file mode 100644 index 0000000000000..f8da932ca9784 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/IdentityUserAssignedIdentitiesValue.cs @@ -0,0 +1,60 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class IdentityUserAssignedIdentitiesValue + { + /// + /// Initializes a new instance of the + /// IdentityUserAssignedIdentitiesValue class. + /// + public IdentityUserAssignedIdentitiesValue() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// IdentityUserAssignedIdentitiesValue class. + /// + /// The principal id of user assigned + /// identity. + /// The client id of user assigned + /// identity. + public IdentityUserAssignedIdentitiesValue(string principalId = default(string), string clientId = default(string)) + { + PrincipalId = principalId; + ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal id of user assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the client id of user assigned identity. + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KeyVaultProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KeyVaultProperties.cs new file mode 100644 index 0000000000000..0ef1e9d452446 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KeyVaultProperties.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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + public partial class KeyVaultProperties + { + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + public KeyVaultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + /// The ArmId of the keyVault where the + /// customer owned encryption key is present. + /// Key vault uri to access the encryption + /// key. + /// For future use - The client id of + /// the identity which will be used to access key vault. + public KeyVaultProperties(string keyVaultArmId, string keyIdentifier, string identityClientId = default(string)) + { + KeyVaultArmId = keyVaultArmId; + KeyIdentifier = keyIdentifier; + IdentityClientId = identityClientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ArmId of the keyVault where the customer owned + /// encryption key is present. + /// + [JsonProperty(PropertyName = "keyVaultArmId")] + public string KeyVaultArmId { get; set; } + + /// + /// Gets or sets key vault uri to access the encryption key. + /// + [JsonProperty(PropertyName = "keyIdentifier")] + public string KeyIdentifier { get; set; } + + /// + /// Gets or sets for future use - The client id of the identity which + /// will be used to access key vault. + /// + [JsonProperty(PropertyName = "identityClientId")] + public string IdentityClientId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (KeyVaultArmId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KeyVaultArmId"); + } + if (KeyIdentifier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KeyIdentifier"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListWorkspaceKeysResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListWorkspaceKeysResult.cs new file mode 100644 index 0000000000000..a0591ff9445f8 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListWorkspaceKeysResult.cs @@ -0,0 +1,70 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ListWorkspaceKeysResult + { + /// + /// Initializes a new instance of the ListWorkspaceKeysResult class. + /// + public ListWorkspaceKeysResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ListWorkspaceKeysResult class. + /// + public ListWorkspaceKeysResult(string userStorageKey = default(string), string userStorageResourceId = default(string), string appInsightsInstrumentationKey = default(string), RegistryListCredentialsResult containerRegistryCredentials = default(RegistryListCredentialsResult), NotebookListCredentialsResult notebookAccessKeys = default(NotebookListCredentialsResult)) + { + UserStorageKey = userStorageKey; + UserStorageResourceId = userStorageResourceId; + AppInsightsInstrumentationKey = appInsightsInstrumentationKey; + ContainerRegistryCredentials = containerRegistryCredentials; + NotebookAccessKeys = notebookAccessKeys; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "userStorageKey")] + public string UserStorageKey { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "userStorageResourceId")] + public string UserStorageResourceId { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "appInsightsInstrumentationKey")] + public string AppInsightsInstrumentationKey { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "containerRegistryCredentials")] + public RegistryListCredentialsResult ContainerRegistryCredentials { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "notebookAccessKeys")] + public NotebookListCredentialsResult NotebookAccessKeys { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeCreateOrUpdateHeaders.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..d5a191293e3fe --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeCreateOrUpdateHeaders.cs @@ -0,0 +1,54 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class MachineLearningComputeCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the + /// MachineLearningComputeCreateOrUpdateHeaders class. + /// + public MachineLearningComputeCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MachineLearningComputeCreateOrUpdateHeaders class. + /// + /// URI to poll for asynchronous + /// operation status. + public MachineLearningComputeCreateOrUpdateHeaders(string azureAsyncOperation = default(string)) + { + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URI to poll for asynchronous operation status. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeDeleteHeaders.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeDeleteHeaders.cs new file mode 100644 index 0000000000000..7d6d028eaf106 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeDeleteHeaders.cs @@ -0,0 +1,63 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class MachineLearningComputeDeleteHeaders + { + /// + /// Initializes a new instance of the + /// MachineLearningComputeDeleteHeaders class. + /// + public MachineLearningComputeDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MachineLearningComputeDeleteHeaders class. + /// + /// URI to poll for asynchronous + /// operation status. + /// URI to poll for asynchronous operation + /// result. + public MachineLearningComputeDeleteHeaders(string azureAsyncOperation = default(string), string location = default(string)) + { + AzureAsyncOperation = azureAsyncOperation; + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URI to poll for asynchronous operation status. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + /// + /// Gets or sets URI to poll for asynchronous operation result. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceError.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceError.cs new file mode 100644 index 0000000000000..e0dc46a7232f2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceError.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Wrapper for error response to follow ARM guidelines. + /// + public partial class MachineLearningServiceError + { + /// + /// Initializes a new instance of the MachineLearningServiceError + /// class. + /// + public MachineLearningServiceError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MachineLearningServiceError + /// class. + /// + /// The error response. + public MachineLearningServiceError(ErrorResponse error = default(ErrorResponse)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error response. + /// + [JsonProperty(PropertyName = "error")] + public ErrorResponse Error { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceErrorException.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceErrorException.cs new file mode 100644 index 0000000000000..f7ae1f4119ef9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceErrorException.cs @@ -0,0 +1,62 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with + /// MachineLearningServiceError information. + /// + public partial class MachineLearningServiceErrorException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public MachineLearningServiceError Body { get; set; } + + /// + /// Initializes a new instance of the MachineLearningServiceErrorException class. + /// + public MachineLearningServiceErrorException() + { + } + + /// + /// Initializes a new instance of the MachineLearningServiceErrorException class. + /// + /// The exception message. + public MachineLearningServiceErrorException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the MachineLearningServiceErrorException class. + /// + /// The exception message. + /// Inner exception. + public MachineLearningServiceErrorException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeState.cs new file mode 100644 index 0000000000000..0bb7f549ceb5e --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeState.cs @@ -0,0 +1,26 @@ +// +// 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.MachineLearningServices.Models +{ + + /// + /// Defines values for NodeState. + /// + public static class NodeState + { + public const string Idle = "idle"; + public const string Running = "running"; + public const string Preparing = "preparing"; + public const string Unusable = "unusable"; + public const string Leaving = "leaving"; + public const string Preempted = "preempted"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeStateCounts.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeStateCounts.cs new file mode 100644 index 0000000000000..20f2be1e29119 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeStateCounts.cs @@ -0,0 +1,109 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Counts of various compute node states on the amlCompute. + /// + public partial class NodeStateCounts + { + /// + /// Initializes a new instance of the NodeStateCounts class. + /// + public NodeStateCounts() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NodeStateCounts class. + /// + /// Idle node count. + /// Running node count. + /// Preparing node count. + /// Unusable node count. + /// Leaving node count. + /// Preempted node count. + public NodeStateCounts(int? idleNodeCount = default(int?), int? runningNodeCount = default(int?), int? preparingNodeCount = default(int?), int? unusableNodeCount = default(int?), int? leavingNodeCount = default(int?), int? preemptedNodeCount = default(int?)) + { + IdleNodeCount = idleNodeCount; + RunningNodeCount = runningNodeCount; + PreparingNodeCount = preparingNodeCount; + UnusableNodeCount = unusableNodeCount; + LeavingNodeCount = leavingNodeCount; + PreemptedNodeCount = preemptedNodeCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets idle node count. + /// + /// + /// Number of compute nodes in idle state. + /// + [JsonProperty(PropertyName = "idleNodeCount")] + public int? IdleNodeCount { get; private set; } + + /// + /// Gets running node count. + /// + /// + /// Number of compute nodes which are running jobs. + /// + [JsonProperty(PropertyName = "runningNodeCount")] + public int? RunningNodeCount { get; private set; } + + /// + /// Gets preparing node count. + /// + /// + /// Number of compute nodes which are being prepared. + /// + [JsonProperty(PropertyName = "preparingNodeCount")] + public int? PreparingNodeCount { get; private set; } + + /// + /// Gets unusable node count. + /// + /// + /// Number of compute nodes which are in unusable state. + /// + [JsonProperty(PropertyName = "unusableNodeCount")] + public int? UnusableNodeCount { get; private set; } + + /// + /// Gets leaving node count. + /// + /// + /// Number of compute nodes which are leaving the amlCompute. + /// + [JsonProperty(PropertyName = "leavingNodeCount")] + public int? LeavingNodeCount { get; private set; } + + /// + /// Gets preempted node count. + /// + /// + /// Number of compute nodes which are in preempted state. + /// + [JsonProperty(PropertyName = "preemptedNodeCount")] + public int? PreemptedNodeCount { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookListCredentialsResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookListCredentialsResult.cs new file mode 100644 index 0000000000000..92e3be667bed9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookListCredentialsResult.cs @@ -0,0 +1,54 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class NotebookListCredentialsResult + { + /// + /// Initializes a new instance of the NotebookListCredentialsResult + /// class. + /// + public NotebookListCredentialsResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotebookListCredentialsResult + /// class. + /// + public NotebookListCredentialsResult(string primaryAccessKey = default(string), string secondaryAccessKey = default(string)) + { + PrimaryAccessKey = primaryAccessKey; + SecondaryAccessKey = secondaryAccessKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "primaryAccessKey")] + public string PrimaryAccessKey { get; set; } + + /// + /// + [JsonProperty(PropertyName = "secondaryAccessKey")] + public string SecondaryAccessKey { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookPreparationError.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookPreparationError.cs new file mode 100644 index 0000000000000..35182f23db9b1 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookPreparationError.cs @@ -0,0 +1,52 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class NotebookPreparationError + { + /// + /// Initializes a new instance of the NotebookPreparationError class. + /// + public NotebookPreparationError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotebookPreparationError class. + /// + public NotebookPreparationError(string errorMessage = default(string), int? statusCode = default(int?)) + { + ErrorMessage = errorMessage; + StatusCode = statusCode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage { get; set; } + + /// + /// + [JsonProperty(PropertyName = "statusCode")] + public int? StatusCode { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookResourceInfo.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookResourceInfo.cs new file mode 100644 index 0000000000000..cc95f0ae282b9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookResourceInfo.cs @@ -0,0 +1,65 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class NotebookResourceInfo + { + /// + /// Initializes a new instance of the NotebookResourceInfo class. + /// + public NotebookResourceInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotebookResourceInfo class. + /// + /// the data plane resourceId that used to + /// initialize notebook component + /// The error that occurs when + /// preparing notebook. + public NotebookResourceInfo(string fqdn = default(string), string resourceId = default(string), NotebookPreparationError notebookPreparationError = default(NotebookPreparationError)) + { + Fqdn = fqdn; + ResourceId = resourceId; + NotebookPreparationError = notebookPreparationError; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "fqdn")] + public string Fqdn { get; set; } + + /// + /// Gets or sets the data plane resourceId that used to initialize + /// notebook component + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets or sets the error that occurs when preparing notebook. + /// + [JsonProperty(PropertyName = "notebookPreparationError")] + public NotebookPreparationError NotebookPreparationError { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Operation.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Operation.cs new file mode 100644 index 0000000000000..de68889311e6e --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Operation.cs @@ -0,0 +1,60 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure Machine Learning workspace REST API operation + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// Operation name: + /// {provider}/{resource}/{operation} + /// Display name of operation + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + { + Name = name; + Display = display; + 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 display name of operation + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationDisplay.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 0000000000000..c7936af142fc5 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationDisplay.cs @@ -0,0 +1,80 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Display name of operation + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// The resource provider name: + /// Microsoft.MachineLearningExperimentation + /// The resource on which the operation is + /// performed. + /// The operation that users can + /// perform. + /// The description for the + /// operation. + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource provider name: + /// Microsoft.MachineLearningExperimentation + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets the resource on which the operation is performed. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + /// + /// Gets or sets the operation that users can perform. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets the description for the operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page.cs new file mode 100644 index 0000000000000..174590e64d54f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/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.MachineLearningServices.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("")] + 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page1.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page1.cs new file mode 100644 index 0000000000000..12e6203f84cff --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page1.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.MachineLearningServices.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 Page1 : 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Password.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Password.cs new file mode 100644 index 0000000000000..22b5d7600608b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Password.cs @@ -0,0 +1,52 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class Password + { + /// + /// Initializes a new instance of the Password class. + /// + public Password() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Password class. + /// + public Password(string name = default(string), string value = default(string)) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpoint.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpoint.cs new file mode 100644 index 0000000000000..904c7dc0dfa05 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpoint.cs @@ -0,0 +1,51 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Private Endpoint resource. + /// + public partial class PrivateEndpoint + { + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + public PrivateEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + /// The ARM identifier for Private Endpoint + public PrivateEndpoint(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the ARM identifier for Private Endpoint + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnection.cs new file mode 100644 index 0000000000000..8efffb3b93ae7 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnection.cs @@ -0,0 +1,119 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Private Endpoint Connection resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateEndpointConnection : IResource + { + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + public PrivateEndpointConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + /// A collection of + /// information about the state of the connection between service + /// consumer and provider. + /// ResourceId of the private endpoint + /// connection. + /// Friendly name of the private endpoint + /// connection. + /// Resource type of private endpoint + /// connection. + /// The resource of private end + /// point. + /// The provisioning state of the + /// private endpoint connection resource. Possible values include: + /// 'Succeeded', 'Creating', 'Deleting', 'Failed' + public PrivateEndpointConnection(PrivateLinkServiceConnectionState privateLinkServiceConnectionState, string id = default(string), string name = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), string provisioningState = default(string)) + { + Id = id; + Name = name; + Type = type; + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resourceId of the private endpoint connection. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets friendly name of the private endpoint connection. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type of private endpoint connection. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets the resource of private end point. + /// + [JsonProperty(PropertyName = "properties.privateEndpoint")] + public PrivateEndpoint PrivateEndpoint { get; set; } + + /// + /// Gets or sets a collection of information about the state of the + /// connection between service consumer and provider. + /// + [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + + /// + /// Gets or sets the provisioning state of the private endpoint + /// connection resource. Possible values include: 'Succeeded', + /// 'Creating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrivateLinkServiceConnectionState == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PrivateLinkServiceConnectionState"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 0000000000000..e5c43266e2286 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs @@ -0,0 +1,24 @@ +// +// 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.MachineLearningServices.Models +{ + + /// + /// Defines values for PrivateEndpointConnectionProvisioningState. + /// + public static class PrivateEndpointConnectionProvisioningState + { + public const string Succeeded = "Succeeded"; + public const string Creating = "Creating"; + public const string Deleting = "Deleting"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 0000000000000..fd8a93df2042c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for PrivateEndpointServiceConnectionStatus. + /// + public static class PrivateEndpointServiceConnectionStatus + { + public const string Pending = "Pending"; + public const string Approved = "Approved"; + public const string Rejected = "Rejected"; + public const string Disconnected = "Disconnected"; + public const string Timeout = "Timeout"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResource.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResource.cs new file mode 100644 index 0000000000000..34967fd37f422 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResource.cs @@ -0,0 +1,94 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A private link resource + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateLinkResource : Resource + { + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + public PrivateLinkResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + /// The private link resource group id. + /// The private link resource required + /// member names. + /// The private link resource Private + /// link DNS zone name. + public PrivateLinkResource(string id = default(string), string name = default(string), Identity identity = default(Identity), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList)) + : base(id, name, identity, location, type, tags, sku) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the private link resource group id. + /// + [JsonProperty(PropertyName = "properties.groupId")] + public string GroupId { get; private set; } + + /// + /// Gets the private link resource required member names. + /// + [JsonProperty(PropertyName = "properties.requiredMembers")] + public IList RequiredMembers { get; private set; } + + /// + /// Gets or sets the private link resource Private link DNS zone name. + /// + [JsonProperty(PropertyName = "properties.requiredZoneNames")] + public IList RequiredZoneNames { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResourceListResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResourceListResult.cs new file mode 100644 index 0000000000000..9070ccc04ea91 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResourceListResult.cs @@ -0,0 +1,55 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A list of private link resources + /// + public partial class PrivateLinkResourceListResult + { + /// + /// Initializes a new instance of the PrivateLinkResourceListResult + /// class. + /// + public PrivateLinkResourceListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResourceListResult + /// class. + /// + /// Array of private link resources + public PrivateLinkResourceListResult(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets array of private link resources + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkServiceConnectionState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkServiceConnectionState.cs new file mode 100644 index 0000000000000..68aac9347c969 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkServiceConnectionState.cs @@ -0,0 +1,79 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A collection of information about the state of the connection between + /// service consumer and provider. + /// + public partial class PrivateLinkServiceConnectionState + { + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + public PrivateLinkServiceConnectionState() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + /// Indicates whether the connection has been + /// Approved/Rejected/Removed by the owner of the service. Possible + /// values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', + /// 'Timeout' + /// The reason for approval/rejection of the + /// connection. + /// A message indicating if changes on + /// the service provider require any updates on the consumer. + public PrivateLinkServiceConnectionState(string status = default(string), string description = default(string), string actionsRequired = default(string)) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates whether the connection has been + /// Approved/Rejected/Removed by the owner of the service. Possible + /// values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', + /// 'Timeout' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the reason for approval/rejection of the connection. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets a message indicating if changes on the service + /// provider require any updates on the consumer. + /// + [JsonProperty(PropertyName = "actionsRequired")] + public string ActionsRequired { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ProvisioningState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 0000000000000..d0cfe37ad21fa --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,27 @@ +// +// 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.MachineLearningServices.Models +{ + + /// + /// Defines values for ProvisioningState. + /// + public static class ProvisioningState + { + public const string Unknown = "Unknown"; + public const string Updating = "Updating"; + public const string Creating = "Creating"; + public const string Deleting = "Deleting"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Canceled = "Canceled"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaBaseProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaBaseProperties.cs new file mode 100644 index 0000000000000..22c890df34eb5 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaBaseProperties.cs @@ -0,0 +1,80 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties for Quota update or retrieval. + /// + public partial class QuotaBaseProperties + { + /// + /// Initializes a new instance of the QuotaBaseProperties class. + /// + public QuotaBaseProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuotaBaseProperties class. + /// + /// Specifies the resource ID. + /// Specifies the resource type. + /// Limit. + /// An enum describing the unit of quota + /// measurement. Possible values include: 'Count' + public QuotaBaseProperties(string id = default(string), string type = default(string), long? limit = default(long?), string unit = default(string)) + { + Id = id; + Type = type; + Limit = limit; + Unit = unit; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets specifies the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets limit. + /// + /// + /// The maximum permitted quota of the resource. + /// + [JsonProperty(PropertyName = "limit")] + public long? Limit { get; set; } + + /// + /// Gets or sets an enum describing the unit of quota measurement. + /// Possible values include: 'Count' + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUnit.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUnit.cs new file mode 100644 index 0000000000000..12fd5189097f4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUnit.cs @@ -0,0 +1,21 @@ +// +// 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.MachineLearningServices.Models +{ + + /// + /// Defines values for QuotaUnit. + /// + public static class QuotaUnit + { + public const string Count = "Count"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUpdateParameters.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUpdateParameters.cs new file mode 100644 index 0000000000000..ca5291df9d677 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUpdateParameters.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Quota update parameters. + /// + public partial class QuotaUpdateParameters + { + /// + /// Initializes a new instance of the QuotaUpdateParameters class. + /// + public QuotaUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuotaUpdateParameters class. + /// + /// The list for update quota. + public QuotaUpdateParameters(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list for update quota. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ReasonCode.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ReasonCode.cs new file mode 100644 index 0000000000000..12544612047b9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ReasonCode.cs @@ -0,0 +1,23 @@ +// +// 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.MachineLearningServices.Models +{ + + /// + /// Defines values for ReasonCode. + /// + public static class ReasonCode + { + public const string NotSpecified = "NotSpecified"; + public const string NotAvailableForRegion = "NotAvailableForRegion"; + public const string NotAvailableForSubscription = "NotAvailableForSubscription"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RegistryListCredentialsResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RegistryListCredentialsResult.cs new file mode 100644 index 0000000000000..4295dd1dc5697 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RegistryListCredentialsResult.cs @@ -0,0 +1,62 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class RegistryListCredentialsResult + { + /// + /// Initializes a new instance of the RegistryListCredentialsResult + /// class. + /// + public RegistryListCredentialsResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RegistryListCredentialsResult + /// class. + /// + public RegistryListCredentialsResult(string location = default(string), string username = default(string), IList passwords = default(IList)) + { + Location = location; + Username = username; + Passwords = passwords; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "username")] + public string Username { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "passwords")] + public IList Passwords { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RemoteLoginPortPublicAccess.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RemoteLoginPortPublicAccess.cs new file mode 100644 index 0000000000000..f8ccbd19c2006 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RemoteLoginPortPublicAccess.cs @@ -0,0 +1,23 @@ +// +// 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.MachineLearningServices.Models +{ + + /// + /// Defines values for RemoteLoginPortPublicAccess. + /// + public static class RemoteLoginPortPublicAccess + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + public const string NotSpecified = "NotSpecified"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Resource.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Resource.cs new file mode 100644 index 0000000000000..c2a126d4964c1 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Resource.cs @@ -0,0 +1,118 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure Resource Manager resource envelope. + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + public Resource(string id = default(string), string name = default(string), Identity identity = default(Identity), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku)) + { + Id = id; + Name = name; + Identity = identity; + Location = location; + Type = type; + Tags = tags; + Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets specifies the name of the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets the identity of the resource. + /// + [JsonProperty(PropertyName = "identity")] + public Identity Identity { get; set; } + + /// + /// Gets or sets specifies the location of the resource. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets specifies the type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets contains resource tags defined as key/value pairs. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the sku of the workspace. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Identity != null) + { + Identity.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceId.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceId.cs new file mode 100644 index 0000000000000..05b8f70cd087a --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceId.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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a resource ID. For example, for a subnet, it is the resource + /// URL for the subnet. + /// + public partial class ResourceId : IResource + { + /// + /// Initializes a new instance of the ResourceId class. + /// + public ResourceId() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceId class. + /// + /// The ID of the resource + public ResourceId(string id) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ID of the resource + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceIdentityType.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceIdentityType.cs new file mode 100644 index 0000000000000..7ebdb973557c3 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceIdentityType.cs @@ -0,0 +1,72 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ResourceIdentityType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ResourceIdentityType + { + [EnumMember(Value = "SystemAssigned")] + SystemAssigned, + [EnumMember(Value = "UserAssigned")] + UserAssigned, + [EnumMember(Value = "SystemAssigned,UserAssigned")] + SystemAssignedUserAssigned, + [EnumMember(Value = "None")] + None + } + internal static class ResourceIdentityTypeEnumExtension + { + internal static string ToSerializedValue(this ResourceIdentityType? value) + { + return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ResourceIdentityType value) + { + switch( value ) + { + case ResourceIdentityType.SystemAssigned: + return "SystemAssigned"; + case ResourceIdentityType.UserAssigned: + return "UserAssigned"; + case ResourceIdentityType.SystemAssignedUserAssigned: + return "SystemAssigned,UserAssigned"; + case ResourceIdentityType.None: + return "None"; + } + return null; + } + + internal static ResourceIdentityType? ParseResourceIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return ResourceIdentityType.SystemAssigned; + case "UserAssigned": + return ResourceIdentityType.UserAssigned; + case "SystemAssigned,UserAssigned": + return ResourceIdentityType.SystemAssignedUserAssigned; + case "None": + return ResourceIdentityType.None; + } + return null; + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceName.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceName.cs new file mode 100644 index 0000000000000..ddf14b962231c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceName.cs @@ -0,0 +1,60 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Resource Name. + /// + public partial class ResourceName + { + /// + /// Initializes a new instance of the ResourceName class. + /// + public ResourceName() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceName class. + /// + /// The name of the resource. + /// The localized name of the + /// resource. + public ResourceName(string value = default(string), string localizedValue = default(string)) + { + Value = value; + LocalizedValue = localizedValue; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the resource. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Gets the localized name of the resource. + /// + [JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceQuota.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceQuota.cs new file mode 100644 index 0000000000000..62a33bab2a5fa --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceQuota.cs @@ -0,0 +1,88 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The quota assigned to a resource. + /// + public partial class ResourceQuota + { + /// + /// Initializes a new instance of the ResourceQuota class. + /// + public ResourceQuota() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceQuota class. + /// + /// Specifies the resource ID. + /// Specifies the resource type. + /// Name of the resource. + /// Limit. + /// An enum describing the unit of quota + /// measurement. Possible values include: 'Count' + public ResourceQuota(string id = default(string), string type = default(string), ResourceName name = default(ResourceName), long? limit = default(long?), string unit = default(string)) + { + Id = id; + Type = type; + Name = name; + Limit = limit; + Unit = unit; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets specifies the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets name of the resource. + /// + [JsonProperty(PropertyName = "name")] + public ResourceName Name { get; private set; } + + /// + /// Gets limit. + /// + /// + /// The maximum permitted quota of the resource. + /// + [JsonProperty(PropertyName = "limit")] + public long? Limit { get; private set; } + + /// + /// Gets an enum describing the unit of quota measurement. Possible + /// values include: 'Count' + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuLocationInfo.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuLocationInfo.cs new file mode 100644 index 0000000000000..6561b786334ea --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuLocationInfo.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class ResourceSkuLocationInfo + { + /// + /// Initializes a new instance of the ResourceSkuLocationInfo class. + /// + public ResourceSkuLocationInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceSkuLocationInfo class. + /// + /// Location of the SKU + /// List of availability zones where the SKU is + /// supported. + /// Details of capabilities available to a + /// SKU in specific zones. + public ResourceSkuLocationInfo(string location = default(string), IList zones = default(IList), IList zoneDetails = default(IList)) + { + Location = location; + Zones = zones; + ZoneDetails = zoneDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets location of the SKU + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets list of availability zones where the SKU is supported. + /// + [JsonProperty(PropertyName = "zones")] + public IList Zones { get; private set; } + + /// + /// Gets details of capabilities available to a SKU in specific zones. + /// + [JsonProperty(PropertyName = "zoneDetails")] + public IList ZoneDetails { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuZoneDetails.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuZoneDetails.cs new file mode 100644 index 0000000000000..ab43f870cc7f8 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuZoneDetails.cs @@ -0,0 +1,65 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes The zonal capabilities of a SKU. + /// + public partial class ResourceSkuZoneDetails + { + /// + /// Initializes a new instance of the ResourceSkuZoneDetails class. + /// + public ResourceSkuZoneDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceSkuZoneDetails class. + /// + /// The set of zones that the SKU is available in + /// with the specified capabilities. + /// A list of capabilities that are + /// available for the SKU in the specified list of zones. + public ResourceSkuZoneDetails(IList name = default(IList), IList capabilities = default(IList)) + { + Name = name; + Capabilities = capabilities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the set of zones that the SKU is available in with the + /// specified capabilities. + /// + [JsonProperty(PropertyName = "name")] + public IList Name { get; private set; } + + /// + /// Gets a list of capabilities that are available for the SKU in the + /// specified list of zones. + /// + [JsonProperty(PropertyName = "capabilities")] + public IList Capabilities { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Restriction.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Restriction.cs new file mode 100644 index 0000000000000..31ae3583e47fa --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Restriction.cs @@ -0,0 +1,79 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The restriction because of which SKU cannot be used. + /// + public partial class Restriction + { + /// + /// Initializes a new instance of the Restriction class. + /// + public Restriction() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Restriction class. + /// + /// The type of restrictions. As of now only + /// possible value for this is location. + /// The value of restrictions. If the restriction + /// type is set to location. This would be different locations where + /// the SKU is restricted. + /// The reason for the restriction. Possible + /// values include: 'NotSpecified', 'NotAvailableForRegion', + /// 'NotAvailableForSubscription' + public Restriction(string type = default(string), IList values = default(IList), string reasonCode = default(string)) + { + Type = type; + Values = values; + ReasonCode = reasonCode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the type of restrictions. As of now only possible value for + /// this is location. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the value of restrictions. If the restriction type is set to + /// location. This would be different locations where the SKU is + /// restricted. + /// + [JsonProperty(PropertyName = "values")] + public IList Values { get; private set; } + + /// + /// Gets or sets the reason for the restriction. Possible values + /// include: 'NotSpecified', 'NotAvailableForRegion', + /// 'NotAvailableForSubscription' + /// + [JsonProperty(PropertyName = "reasonCode")] + public string ReasonCode { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SKUCapability.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SKUCapability.cs new file mode 100644 index 0000000000000..2a70b2cd017a2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SKUCapability.cs @@ -0,0 +1,59 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Features/user capabilities associated with the sku + /// + public partial class SKUCapability + { + /// + /// Initializes a new instance of the SKUCapability class. + /// + public SKUCapability() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SKUCapability class. + /// + /// Capability/Feature ID + /// Details about the feature/capability + public SKUCapability(string name = default(string), string value = default(string)) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets capability/Feature ID + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets details about the feature/capability + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScaleSettings.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScaleSettings.cs new file mode 100644 index 0000000000000..b17e0adad4cce --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScaleSettings.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// scale settings for AML Compute + /// + public partial class ScaleSettings + { + /// + /// Initializes a new instance of the ScaleSettings class. + /// + public ScaleSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScaleSettings class. + /// + /// Max number of nodes to use + /// Min number of nodes to use + /// Node Idle Time before + /// scaling down amlCompute + public ScaleSettings(int maxNodeCount, int? minNodeCount = default(int?), System.TimeSpan? nodeIdleTimeBeforeScaleDown = default(System.TimeSpan?)) + { + MaxNodeCount = maxNodeCount; + MinNodeCount = minNodeCount; + NodeIdleTimeBeforeScaleDown = nodeIdleTimeBeforeScaleDown; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets max number of nodes to use + /// + [JsonProperty(PropertyName = "maxNodeCount")] + public int MaxNodeCount { get; set; } + + /// + /// Gets or sets min number of nodes to use + /// + [JsonProperty(PropertyName = "minNodeCount")] + public int? MinNodeCount { get; set; } + + /// + /// Gets or sets node Idle Time before scaling down amlCompute + /// + [JsonProperty(PropertyName = "nodeIdleTimeBeforeScaleDown")] + public System.TimeSpan? NodeIdleTimeBeforeScaleDown { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ServicePrincipalCredentials.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ServicePrincipalCredentials.cs new file mode 100644 index 0000000000000..94943dd5d243a --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ServicePrincipalCredentials.cs @@ -0,0 +1,79 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Service principal credentials. + /// + public partial class ServicePrincipalCredentials + { + /// + /// Initializes a new instance of the ServicePrincipalCredentials + /// class. + /// + public ServicePrincipalCredentials() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServicePrincipalCredentials + /// class. + /// + /// Client Id + /// Client secret + public ServicePrincipalCredentials(string clientId, string clientSecret) + { + ClientId = clientId; + ClientSecret = clientSecret; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets client Id + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; set; } + + /// + /// Gets or sets client secret + /// + [JsonProperty(PropertyName = "clientSecret")] + public string ClientSecret { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ClientId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ClientId"); + } + if (ClientSecret == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ClientSecret"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SharedPrivateLinkResource.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SharedPrivateLinkResource.cs new file mode 100644 index 0000000000000..de547121006f9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SharedPrivateLinkResource.cs @@ -0,0 +1,90 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] + public partial class SharedPrivateLinkResource + { + /// + /// Initializes a new instance of the SharedPrivateLinkResource class. + /// + public SharedPrivateLinkResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedPrivateLinkResource class. + /// + /// Unique name of the private link. + /// The resource id that private + /// link links to. + /// The private link resource group id. + /// Request message. + /// Indicates whether the connection has been + /// Approved/Rejected/Removed by the owner of the service. Possible + /// values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', + /// 'Timeout' + public SharedPrivateLinkResource(string name = default(string), string privateLinkResourceId = default(string), string groupId = default(string), string requestMessage = default(string), string status = default(string)) + { + Name = name; + PrivateLinkResourceId = privateLinkResourceId; + GroupId = groupId; + RequestMessage = requestMessage; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unique name of the private link. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the resource id that private link links to. + /// + [JsonProperty(PropertyName = "properties.privateLinkResourceId")] + public string PrivateLinkResourceId { get; set; } + + /// + /// Gets or sets the private link resource group id. + /// + [JsonProperty(PropertyName = "properties.groupId")] + public string GroupId { get; set; } + + /// + /// Gets or sets request message. + /// + [JsonProperty(PropertyName = "properties.requestMessage")] + public string RequestMessage { get; set; } + + /// + /// Gets or sets indicates whether the connection has been + /// Approved/Rejected/Removed by the owner of the service. Possible + /// values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', + /// 'Timeout' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Sku.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Sku.cs new file mode 100644 index 0000000000000..24aa1c1752094 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Sku.cs @@ -0,0 +1,59 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Sku of the resource + /// + public partial class Sku + { + /// + /// Initializes a new instance of the Sku class. + /// + public Sku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Sku class. + /// + /// Name of the sku + /// Tier of the sku like Basic or Enterprise + public Sku(string name = default(string), string tier = default(string)) + { + Name = name; + Tier = tier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the sku + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets tier of the sku like Basic or Enterprise + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SkuSettings.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SkuSettings.cs new file mode 100644 index 0000000000000..04e47d89d808b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SkuSettings.cs @@ -0,0 +1,106 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes Workspace Sku details and features + /// + public partial class SkuSettings + { + /// + /// Initializes a new instance of the SkuSettings class. + /// + public SkuSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuSettings class. + /// + /// The set of locations that the SKU is + /// available. This will be supported and registered Azure Geo Regions + /// (e.g. West US, East US, Southeast Asia, etc.). + /// A list of locations and availability + /// zones in those locations where the SKU is available. + /// Sku Tier like Basic or Enterprise + /// List of features/user capabilities + /// associated with the sku + /// The restrictions because of which SKU + /// cannot be used. This is empty if there are no restrictions. + public SkuSettings(IList locations = default(IList), IList locationInfo = default(IList), string tier = default(string), string resourceType = default(string), string name = default(string), IList capabilities = default(IList), IList restrictions = default(IList)) + { + Locations = locations; + LocationInfo = locationInfo; + Tier = tier; + ResourceType = resourceType; + Name = name; + Capabilities = capabilities; + Restrictions = restrictions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the set of locations that the SKU is available. This will be + /// supported and registered Azure Geo Regions (e.g. West US, East US, + /// Southeast Asia, etc.). + /// + [JsonProperty(PropertyName = "locations")] + public IList Locations { get; private set; } + + /// + /// Gets a list of locations and availability zones in those locations + /// where the SKU is available. + /// + [JsonProperty(PropertyName = "locationInfo")] + public IList LocationInfo { get; private set; } + + /// + /// Gets sku Tier like Basic or Enterprise + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets list of features/user capabilities associated with the sku + /// + [JsonProperty(PropertyName = "capabilities")] + public IList Capabilities { get; private set; } + + /// + /// Gets or sets the restrictions because of which SKU cannot be used. + /// This is empty if there are no restrictions. + /// + [JsonProperty(PropertyName = "restrictions")] + public IList Restrictions { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SshPublicAccess.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SshPublicAccess.cs new file mode 100644 index 0000000000000..f90cf17a41804 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SshPublicAccess.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.MachineLearningServices.Models +{ + + /// + /// Defines values for SshPublicAccess. + /// + public static class SshPublicAccess + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SslConfiguration.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SslConfiguration.cs new file mode 100644 index 0000000000000..13cffc845b353 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SslConfiguration.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The ssl configuration for scoring + /// + public partial class SslConfiguration + { + /// + /// Initializes a new instance of the SslConfiguration class. + /// + public SslConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SslConfiguration class. + /// + /// Enable or disable ssl for scoring. Possible + /// values include: 'Disabled', 'Enabled' + /// Cert data + /// Key data + /// CNAME of the cert + public SslConfiguration(string status = default(string), string cert = default(string), string key = default(string), string cname = default(string)) + { + Status = status; + Cert = cert; + Key = key; + Cname = cname; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets enable or disable ssl for scoring. Possible values + /// include: 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets cert data + /// + [JsonProperty(PropertyName = "cert")] + public string Cert { get; set; } + + /// + /// Gets or sets key data + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; set; } + + /// + /// Gets or sets CNAME of the cert + /// + [JsonProperty(PropertyName = "cname")] + public string Cname { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Status.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Status.cs new file mode 100644 index 0000000000000..11bbc3f1f1e29 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Status.cs @@ -0,0 +1,28 @@ +// +// 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.MachineLearningServices.Models +{ + + /// + /// Defines values for Status. + /// + public static class Status + { + public const string Undefined = "Undefined"; + public const string Success = "Success"; + public const string Failure = "Failure"; + public const string InvalidQuotaBelowClusterMinimum = "InvalidQuotaBelowClusterMinimum"; + public const string InvalidQuotaExceedsSubscriptionLimit = "InvalidQuotaExceedsSubscriptionLimit"; + public const string InvalidVMFamilyName = "InvalidVMFamilyName"; + public const string OperationNotSupportedForSku = "OperationNotSupportedForSku"; + public const string OperationNotEnabledForRegion = "OperationNotEnabledForRegion"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SystemService.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SystemService.cs new file mode 100644 index 0000000000000..36098f27a5a07 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SystemService.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A system service running on a compute. + /// + public partial class SystemService + { + /// + /// Initializes a new instance of the SystemService class. + /// + public SystemService() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemService class. + /// + /// The type of this system + /// service. + /// Public IP address + /// The version for this type. + public SystemService(string systemServiceType = default(string), string publicIpAddress = default(string), string version = default(string)) + { + SystemServiceType = systemServiceType; + PublicIpAddress = publicIpAddress; + Version = version; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the type of this system service. + /// + [JsonProperty(PropertyName = "systemServiceType")] + public string SystemServiceType { get; private set; } + + /// + /// Gets public IP address + /// + [JsonProperty(PropertyName = "publicIpAddress")] + public string PublicIpAddress { get; private set; } + + /// + /// Gets the version for this type. + /// + [JsonProperty(PropertyName = "version")] + public string Version { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UnderlyingResourceAction.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UnderlyingResourceAction.cs new file mode 100644 index 0000000000000..a5a9773cfe21d --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UnderlyingResourceAction.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.MachineLearningServices.Models +{ + + /// + /// Defines values for UnderlyingResourceAction. + /// + public static class UnderlyingResourceAction + { + public const string Delete = "Delete"; + public const string Detach = "Detach"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotas.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotas.cs new file mode 100644 index 0000000000000..dfbed6af6800c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotas.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties for update Quota response. + /// + public partial class UpdateWorkspaceQuotas + { + /// + /// Initializes a new instance of the UpdateWorkspaceQuotas class. + /// + public UpdateWorkspaceQuotas() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpdateWorkspaceQuotas class. + /// + /// Specifies the resource ID. + /// Specifies the resource type. + /// Limit. + /// An enum describing the unit of quota + /// measurement. Possible values include: 'Count' + /// Update Workspace Quota Status. + public UpdateWorkspaceQuotas(string id = default(string), string type = default(string), long? limit = default(long?), string unit = default(string), string status = default(string)) + { + Id = id; + Type = type; + Limit = limit; + Unit = unit; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets specifies the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets limit. + /// + /// + /// The maximum permitted quota of the resource. + /// + [JsonProperty(PropertyName = "limit")] + public long? Limit { get; set; } + + /// + /// Gets an enum describing the unit of quota measurement. Possible + /// values include: 'Count' + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; private set; } + + /// + /// Gets or sets update Workspace Quota Status. + /// + /// + /// Status of update workspace quota. Possible values include: + /// 'Undefined', 'Success', 'Failure', + /// 'InvalidQuotaBelowClusterMinimum', + /// 'InvalidQuotaExceedsSubscriptionLimit', 'InvalidVMFamilyName', + /// 'OperationNotSupportedForSku', 'OperationNotEnabledForRegion' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotasResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotasResult.cs new file mode 100644 index 0000000000000..8f98ce6534008 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotasResult.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The result of update workspace quota. + /// + public partial class UpdateWorkspaceQuotasResult + { + /// + /// Initializes a new instance of the UpdateWorkspaceQuotasResult + /// class. + /// + public UpdateWorkspaceQuotasResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpdateWorkspaceQuotasResult + /// class. + /// + /// The list of workspace quota update + /// result. + /// The URI to fetch the next page of workspace + /// quota update result. Call ListNext() with this to fetch the next + /// page of Workspace Quota update result. + public UpdateWorkspaceQuotasResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the list of workspace quota update result. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } + + /// + /// Gets the URI to fetch the next page of workspace quota update + /// result. Call ListNext() with this to fetch the next page of + /// Workspace Quota update result. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Usage.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Usage.cs new file mode 100644 index 0000000000000..ebc2a6ae74580 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Usage.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes AML Resource Usage. + /// + public partial class Usage + { + /// + /// Initializes a new instance of the Usage class. + /// + public Usage() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Usage class. + /// + /// Specifies the resource ID. + /// Specifies the resource type. + /// An enum describing the unit of usage + /// measurement. Possible values include: 'Count' + /// The current usage of the + /// resource. + /// The maximum permitted usage of the + /// resource. + /// The name of the type of usage. + public Usage(string id = default(string), string type = default(string), string unit = default(string), long? currentValue = default(long?), long? limit = default(long?), UsageName name = default(UsageName)) + { + Id = id; + Type = type; + Unit = unit; + CurrentValue = currentValue; + Limit = limit; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets specifies the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets an enum describing the unit of usage measurement. Possible + /// values include: 'Count' + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; private set; } + + /// + /// Gets the current usage of the resource. + /// + [JsonProperty(PropertyName = "currentValue")] + public long? CurrentValue { get; private set; } + + /// + /// Gets the maximum permitted usage of the resource. + /// + [JsonProperty(PropertyName = "limit")] + public long? Limit { get; private set; } + + /// + /// Gets the name of the type of usage. + /// + [JsonProperty(PropertyName = "name")] + public UsageName Name { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageName.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageName.cs new file mode 100644 index 0000000000000..644d7026acde7 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageName.cs @@ -0,0 +1,60 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Usage Names. + /// + public partial class UsageName + { + /// + /// Initializes a new instance of the UsageName class. + /// + public UsageName() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UsageName class. + /// + /// The name of the resource. + /// The localized name of the + /// resource. + public UsageName(string value = default(string), string localizedValue = default(string)) + { + Value = value; + LocalizedValue = localizedValue; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the resource. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Gets the localized name of the resource. + /// + [JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageUnit.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageUnit.cs new file mode 100644 index 0000000000000..fc4844f9e9442 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageUnit.cs @@ -0,0 +1,21 @@ +// +// 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.MachineLearningServices.Models +{ + + /// + /// Defines values for UsageUnit. + /// + public static class UsageUnit + { + public const string Count = "Count"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UserAccountCredentials.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UserAccountCredentials.cs new file mode 100644 index 0000000000000..40bd590944839 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UserAccountCredentials.cs @@ -0,0 +1,92 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Settings for user account that gets created on each on the nodes of a + /// compute. + /// + public partial class UserAccountCredentials + { + /// + /// Initializes a new instance of the UserAccountCredentials class. + /// + public UserAccountCredentials() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserAccountCredentials class. + /// + /// User name. + /// SSH public key. + /// Password. + public UserAccountCredentials(string adminUserName, string adminUserSshPublicKey = default(string), string adminUserPassword = default(string)) + { + AdminUserName = adminUserName; + AdminUserSshPublicKey = adminUserSshPublicKey; + AdminUserPassword = adminUserPassword; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets user name. + /// + /// + /// Name of the administrator user account which can be used to SSH to + /// nodes. + /// + [JsonProperty(PropertyName = "adminUserName")] + public string AdminUserName { get; set; } + + /// + /// Gets or sets SSH public key. + /// + /// + /// SSH public key of the administrator user account. + /// + [JsonProperty(PropertyName = "adminUserSshPublicKey")] + public string AdminUserSshPublicKey { get; set; } + + /// + /// Gets or sets password. + /// + /// + /// Password of the administrator user account. + /// + [JsonProperty(PropertyName = "adminUserPassword")] + public string AdminUserPassword { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AdminUserName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AdminUserName"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachine.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachine.cs new file mode 100644 index 0000000000000..304629d360812 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachine.cs @@ -0,0 +1,70 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A Machine Learning compute based on Azure Virtual Machines. + /// + public partial class VirtualMachine : Compute + { + /// + /// Initializes a new instance of the VirtualMachine class. + /// + public VirtualMachine() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachine class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + public VirtualMachine(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), VirtualMachineProperties properties = default(VirtualMachineProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public VirtualMachineProperties Properties { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineProperties.cs new file mode 100644 index 0000000000000..1114df6ff66f2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineProperties.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class VirtualMachineProperties + { + /// + /// Initializes a new instance of the VirtualMachineProperties class. + /// + public VirtualMachineProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineProperties class. + /// + /// Virtual Machine size + /// Port open for ssh connections. + /// Public IP address of the virtual + /// machine. + /// Admin credentials for virtual + /// machine + public VirtualMachineProperties(string virtualMachineSize = default(string), int? sshPort = default(int?), string address = default(string), VirtualMachineSshCredentials administratorAccount = default(VirtualMachineSshCredentials)) + { + VirtualMachineSize = virtualMachineSize; + SshPort = sshPort; + Address = address; + AdministratorAccount = administratorAccount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual Machine size + /// + [JsonProperty(PropertyName = "virtualMachineSize")] + public string VirtualMachineSize { get; set; } + + /// + /// Gets or sets port open for ssh connections. + /// + [JsonProperty(PropertyName = "sshPort")] + public int? SshPort { get; set; } + + /// + /// Gets or sets public IP address of the virtual machine. + /// + [JsonProperty(PropertyName = "address")] + public string Address { get; set; } + + /// + /// Gets or sets admin credentials for virtual machine + /// + [JsonProperty(PropertyName = "administratorAccount")] + public VirtualMachineSshCredentials AdministratorAccount { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSecrets.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSecrets.cs new file mode 100644 index 0000000000000..07c927a68ccc2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSecrets.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Secrets related to a Machine Learning compute based on AKS. + /// + [Newtonsoft.Json.JsonObject("VirtualMachine")] + public partial class VirtualMachineSecrets : ComputeSecrets + { + /// + /// Initializes a new instance of the VirtualMachineSecrets class. + /// + public VirtualMachineSecrets() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineSecrets class. + /// + /// Admin credentials for virtual + /// machine. + public VirtualMachineSecrets(VirtualMachineSshCredentials administratorAccount = default(VirtualMachineSshCredentials)) + { + AdministratorAccount = administratorAccount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets admin credentials for virtual machine. + /// + [JsonProperty(PropertyName = "administratorAccount")] + public VirtualMachineSshCredentials AdministratorAccount { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSize.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSize.cs new file mode 100644 index 0000000000000..7b5e0ab72b0fc --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSize.cs @@ -0,0 +1,143 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the properties of a VM size. + /// + public partial class VirtualMachineSize + { + /// + /// Initializes a new instance of the VirtualMachineSize class. + /// + public VirtualMachineSize() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineSize class. + /// + /// Virtual Machine size name + /// Virtual Machine family name + /// Number of vPUs + /// Number of gPUs + /// OS VHD Disk size + /// Resource volume size + /// Memory size + /// Low priority capable + /// Premium IO supported + public VirtualMachineSize(string name = default(string), string family = default(string), int? vCPUs = default(int?), int? gpus = default(int?), int? osVhdSizeMB = default(int?), int? maxResourceVolumeMB = default(int?), double? memoryGB = default(double?), bool? lowPriorityCapable = default(bool?), bool? premiumIO = default(bool?)) + { + Name = name; + Family = family; + VCPUs = vCPUs; + Gpus = gpus; + OsVhdSizeMB = osVhdSizeMB; + MaxResourceVolumeMB = maxResourceVolumeMB; + MemoryGB = memoryGB; + LowPriorityCapable = lowPriorityCapable; + PremiumIO = premiumIO; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets virtual Machine size name + /// + /// + /// The name of the virtual machine size. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets virtual Machine family name + /// + /// + /// The family name of the virtual machine size. + /// + [JsonProperty(PropertyName = "family")] + public string Family { get; private set; } + + /// + /// Gets number of vPUs + /// + /// + /// The number of vCPUs supported by the virtual machine size. + /// + [JsonProperty(PropertyName = "vCPUs")] + public int? VCPUs { get; private set; } + + /// + /// Gets number of gPUs + /// + /// + /// The number of gPUs supported by the virtual machine size. + /// + [JsonProperty(PropertyName = "gpus")] + public int? Gpus { get; private set; } + + /// + /// Gets OS VHD Disk size + /// + /// + /// The OS VHD disk size, in MB, allowed by the virtual machine size. + /// + [JsonProperty(PropertyName = "osVhdSizeMB")] + public int? OsVhdSizeMB { get; private set; } + + /// + /// Gets resource volume size + /// + /// + /// The resource volume size, in MB, allowed by the virtual machine + /// size. + /// + [JsonProperty(PropertyName = "maxResourceVolumeMB")] + public int? MaxResourceVolumeMB { get; private set; } + + /// + /// Gets memory size + /// + /// + /// The amount of memory, in GB, supported by the virtual machine size. + /// + [JsonProperty(PropertyName = "memoryGB")] + public double? MemoryGB { get; private set; } + + /// + /// Gets low priority capable + /// + /// + /// Specifies if the virtual machine size supports low priority VMs. + /// + [JsonProperty(PropertyName = "lowPriorityCapable")] + public bool? LowPriorityCapable { get; private set; } + + /// + /// Gets premium IO supported + /// + /// + /// Specifies if the virtual machine size supports premium IO. + /// + [JsonProperty(PropertyName = "premiumIO")] + public bool? PremiumIO { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSizeListResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSizeListResult.cs new file mode 100644 index 0000000000000..ceb2b080c64f3 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSizeListResult.cs @@ -0,0 +1,57 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The List Virtual Machine size operation response. + /// + public partial class VirtualMachineSizeListResult + { + /// + /// Initializes a new instance of the VirtualMachineSizeListResult + /// class. + /// + public VirtualMachineSizeListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineSizeListResult + /// class. + /// + /// The list of virtual machine sizes + /// supported by AmlCompute. + public VirtualMachineSizeListResult(IList amlCompute = default(IList)) + { + AmlCompute = amlCompute; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of virtual machine sizes supported by + /// AmlCompute. + /// + [JsonProperty(PropertyName = "amlCompute")] + public IList AmlCompute { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSshCredentials.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSshCredentials.cs new file mode 100644 index 0000000000000..d0265f84753cd --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSshCredentials.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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Admin credentials for virtual machine + /// + public partial class VirtualMachineSshCredentials + { + /// + /// Initializes a new instance of the VirtualMachineSshCredentials + /// class. + /// + public VirtualMachineSshCredentials() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineSshCredentials + /// class. + /// + /// Username of admin account + /// Password of admin account + /// Public key data + /// Private key data + public VirtualMachineSshCredentials(string username = default(string), string password = default(string), string publicKeyData = default(string), string privateKeyData = default(string)) + { + Username = username; + Password = password; + PublicKeyData = publicKeyData; + PrivateKeyData = privateKeyData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets username of admin account + /// + [JsonProperty(PropertyName = "username")] + public string Username { get; set; } + + /// + /// Gets or sets password of admin account + /// + [JsonProperty(PropertyName = "password")] + public string Password { get; set; } + + /// + /// Gets or sets public key data + /// + [JsonProperty(PropertyName = "publicKeyData")] + public string PublicKeyData { get; set; } + + /// + /// Gets or sets private key data + /// + [JsonProperty(PropertyName = "privateKeyData")] + public string PrivateKeyData { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VmPriority.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VmPriority.cs new file mode 100644 index 0000000000000..699eace389264 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VmPriority.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.MachineLearningServices.Models +{ + + /// + /// Defines values for VmPriority. + /// + public static class VmPriority + { + public const string Dedicated = "Dedicated"; + public const string LowPriority = "LowPriority"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Workspace.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Workspace.cs new file mode 100644 index 0000000000000..d44b473725874 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Workspace.cs @@ -0,0 +1,281 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An object that represents a machine learning workspace. + /// + [Rest.Serialization.JsonTransformation] + public partial class Workspace : Resource + { + /// + /// Initializes a new instance of the Workspace class. + /// + public Workspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Workspace class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + /// The immutable id associated with this + /// workspace. + /// The description of this + /// workspace. + /// The friendly name for this workspace. + /// This name in mutable + /// The creation time of the machine + /// learning workspace in ISO8601 format. + /// ARM id of the key vault associated with this + /// workspace. This cannot be changed once the workspace has been + /// created + /// ARM id of the application + /// insights associated with this workspace. This cannot be changed + /// once the workspace has been created + /// ARM id of the container registry + /// associated with this workspace. This cannot be changed once the + /// workspace has been created + /// ARM id of the storage account + /// associated with this workspace. This cannot be changed once the + /// workspace has been created + /// Url for the discovery service to + /// identify regional endpoints for machine learning experimentation + /// services + /// The current deployment state of + /// workspace resource. The provisioningState is to indicate states for + /// resource provisioning. Possible values include: 'Unknown', + /// 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', + /// 'Canceled' + /// The encryption settings of Azure ML + /// workspace. + /// The flag to signal HBI data in the + /// workspace and reduce diagnostic data collected by the + /// service + /// The name of the + /// managed resource group created by workspace RP in customer + /// subscription if the workspace is CMK workspace + /// Count of private connections in the + /// workspace + /// The compute name for image + /// build + /// The flag to indicate + /// whether to allow public access when behind VNet. + /// The list of private + /// endpoint connections in the workspace. + /// The list of shared private + /// link resources in this workspace. + /// The notebook info of Azure ML + /// workspace. + public Workspace(string id = default(string), string name = default(string), Identity identity = default(Identity), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string workspaceId = default(string), string description = default(string), string friendlyName = default(string), System.DateTime? creationTime = default(System.DateTime?), string keyVault = default(string), string applicationInsights = default(string), string containerRegistry = default(string), string storageAccount = default(string), string discoveryUrl = default(string), string provisioningState = default(string), EncryptionProperty encryption = default(EncryptionProperty), bool? hbiWorkspace = default(bool?), string serviceProvisionedResourceGroup = default(string), int? privateLinkCount = default(int?), string imageBuildCompute = default(string), bool? allowPublicAccessWhenBehindVnet = default(bool?), IList privateEndpointConnections = default(IList), IList sharedPrivateLinkResources = default(IList), NotebookResourceInfo notebookInfo = default(NotebookResourceInfo)) + : base(id, name, identity, location, type, tags, sku) + { + WorkspaceId = workspaceId; + Description = description; + FriendlyName = friendlyName; + CreationTime = creationTime; + KeyVault = keyVault; + ApplicationInsights = applicationInsights; + ContainerRegistry = containerRegistry; + StorageAccount = storageAccount; + DiscoveryUrl = discoveryUrl; + ProvisioningState = provisioningState; + Encryption = encryption; + HbiWorkspace = hbiWorkspace; + ServiceProvisionedResourceGroup = serviceProvisionedResourceGroup; + PrivateLinkCount = privateLinkCount; + ImageBuildCompute = imageBuildCompute; + AllowPublicAccessWhenBehindVnet = allowPublicAccessWhenBehindVnet; + PrivateEndpointConnections = privateEndpointConnections; + SharedPrivateLinkResources = sharedPrivateLinkResources; + NotebookInfo = notebookInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the immutable id associated with this workspace. + /// + [JsonProperty(PropertyName = "properties.workspaceId")] + public string WorkspaceId { get; private set; } + + /// + /// Gets or sets the description of this workspace. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets the friendly name for this workspace. This name in + /// mutable + /// + [JsonProperty(PropertyName = "properties.friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets the creation time of the machine learning workspace in ISO8601 + /// format. + /// + [JsonProperty(PropertyName = "properties.creationTime")] + public System.DateTime? CreationTime { get; private set; } + + /// + /// Gets or sets ARM id of the key vault associated with this + /// workspace. This cannot be changed once the workspace has been + /// created + /// + [JsonProperty(PropertyName = "properties.keyVault")] + public string KeyVault { get; set; } + + /// + /// Gets or sets ARM id of the application insights associated with + /// this workspace. This cannot be changed once the workspace has been + /// created + /// + [JsonProperty(PropertyName = "properties.applicationInsights")] + public string ApplicationInsights { get; set; } + + /// + /// Gets or sets ARM id of the container registry associated with this + /// workspace. This cannot be changed once the workspace has been + /// created + /// + [JsonProperty(PropertyName = "properties.containerRegistry")] + public string ContainerRegistry { get; set; } + + /// + /// Gets or sets ARM id of the storage account associated with this + /// workspace. This cannot be changed once the workspace has been + /// created + /// + [JsonProperty(PropertyName = "properties.storageAccount")] + public string StorageAccount { get; set; } + + /// + /// Gets or sets url for the discovery service to identify regional + /// endpoints for machine learning experimentation services + /// + [JsonProperty(PropertyName = "properties.discoveryUrl")] + public string DiscoveryUrl { get; set; } + + /// + /// Gets the current deployment state of workspace resource. The + /// provisioningState is to indicate states for resource provisioning. + /// Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the encryption settings of Azure ML workspace. + /// + [JsonProperty(PropertyName = "properties.encryption")] + public EncryptionProperty Encryption { get; set; } + + /// + /// Gets or sets the flag to signal HBI data in the workspace and + /// reduce diagnostic data collected by the service + /// + [JsonProperty(PropertyName = "properties.hbiWorkspace")] + public bool? HbiWorkspace { get; set; } + + /// + /// Gets the name of the managed resource group created by workspace RP + /// in customer subscription if the workspace is CMK workspace + /// + [JsonProperty(PropertyName = "properties.serviceProvisionedResourceGroup")] + public string ServiceProvisionedResourceGroup { get; private set; } + + /// + /// Gets count of private connections in the workspace + /// + [JsonProperty(PropertyName = "properties.privateLinkCount")] + public int? PrivateLinkCount { get; private set; } + + /// + /// Gets or sets the compute name for image build + /// + [JsonProperty(PropertyName = "properties.imageBuildCompute")] + public string ImageBuildCompute { get; set; } + + /// + /// Gets or sets the flag to indicate whether to allow public access + /// when behind VNet. + /// + [JsonProperty(PropertyName = "properties.allowPublicAccessWhenBehindVnet")] + public bool? AllowPublicAccessWhenBehindVnet { get; set; } + + /// + /// Gets the list of private endpoint connections in the workspace. + /// + [JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public IList PrivateEndpointConnections { get; private set; } + + /// + /// Gets or sets the list of shared private link resources in this + /// workspace. + /// + [JsonProperty(PropertyName = "properties.sharedPrivateLinkResources")] + public IList SharedPrivateLinkResources { get; set; } + + /// + /// Gets the notebook info of Azure ML workspace. + /// + [JsonProperty(PropertyName = "properties.notebookInfo")] + public NotebookResourceInfo NotebookInfo { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Encryption != null) + { + Encryption.Validate(); + } + if (PrivateEndpointConnections != null) + { + foreach (var element in PrivateEndpointConnections) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceConnection.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceConnection.cs new file mode 100644 index 0000000000000..a05c7474837f4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceConnection.cs @@ -0,0 +1,107 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Workspace connection. + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkspaceConnection : IResource + { + /// + /// Initializes a new instance of the WorkspaceConnection class. + /// + public WorkspaceConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceConnection class. + /// + /// ResourceId of the workspace connection. + /// Friendly name of the workspace + /// connection. + /// Resource type of workspace connection. + /// Category of the workspace + /// connection. + /// Target of the workspace connection. + /// Authorization type of the workspace + /// connection. + /// Value details of the workspace + /// connection. + public WorkspaceConnection(string id = default(string), string name = default(string), string type = default(string), string category = default(string), string target = default(string), string authType = default(string), string value = default(string)) + { + Id = id; + Name = name; + Type = type; + Category = category; + Target = target; + AuthType = authType; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resourceId of the workspace connection. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets friendly name of the workspace connection. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type of workspace connection. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets category of the workspace connection. + /// + [JsonProperty(PropertyName = "properties.category")] + public string Category { get; set; } + + /// + /// Gets or sets target of the workspace connection. + /// + [JsonProperty(PropertyName = "properties.target")] + public string Target { get; set; } + + /// + /// Gets or sets authorization type of the workspace connection. + /// + [JsonProperty(PropertyName = "properties.authType")] + public string AuthType { get; set; } + + /// + /// Gets or sets value details of the workspace connection. + /// + [JsonProperty(PropertyName = "properties.value")] + public string Value { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceConnectionDto.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceConnectionDto.cs new file mode 100644 index 0000000000000..2551e6ca5e208 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceConnectionDto.cs @@ -0,0 +1,90 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// object used for creating workspace connection. + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkspaceConnectionDto + { + /// + /// Initializes a new instance of the WorkspaceConnectionDto class. + /// + public WorkspaceConnectionDto() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceConnectionDto class. + /// + /// Friendly name of the workspace + /// connection + /// Category of the workspace + /// connection. + /// Target of the workspace connection. + /// Authorization type of the workspace + /// connection. + /// Value details of the workspace + /// connection. + public WorkspaceConnectionDto(string name = default(string), string category = default(string), string target = default(string), string authType = default(string), string value = default(string)) + { + Name = name; + Category = category; + Target = target; + AuthType = authType; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the workspace connection + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets category of the workspace connection. + /// + [JsonProperty(PropertyName = "properties.category")] + public string Category { get; set; } + + /// + /// Gets or sets target of the workspace connection. + /// + [JsonProperty(PropertyName = "properties.target")] + public string Target { get; set; } + + /// + /// Gets or sets authorization type of the workspace connection. + /// + [JsonProperty(PropertyName = "properties.authType")] + public string AuthType { get; set; } + + /// + /// Gets or sets value details of the workspace connection. + /// + [JsonProperty(PropertyName = "properties.value")] + public string Value { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceSku.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceSku.cs new file mode 100644 index 0000000000000..64d9df7ffdcd8 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceSku.cs @@ -0,0 +1,59 @@ +// +// 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.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AML workspace sku information + /// + public partial class WorkspaceSku + { + /// + /// Initializes a new instance of the WorkspaceSku class. + /// + public WorkspaceSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceSku class. + /// + /// The list of workspace sku settings + public WorkspaceSku(string resourceType = default(string), IList skus = default(IList)) + { + ResourceType = resourceType; + Skus = skus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; private set; } + + /// + /// Gets the list of workspace sku settings + /// + [JsonProperty(PropertyName = "skus")] + public IList Skus { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceUpdateParameters.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceUpdateParameters.cs new file mode 100644 index 0000000000000..e2dbf7444adbd --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceUpdateParameters.cs @@ -0,0 +1,83 @@ +// +// 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.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The parameters for updating a machine learning workspace. + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkspaceUpdateParameters + { + /// + /// Initializes a new instance of the WorkspaceUpdateParameters class. + /// + public WorkspaceUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceUpdateParameters class. + /// + /// The resource tags for the machine learning + /// workspace. + /// The sku of the workspace. + /// The description of this + /// workspace. + /// The friendly name for this + /// workspace. + public WorkspaceUpdateParameters(IDictionary tags = default(IDictionary), Sku sku = default(Sku), string description = default(string), string friendlyName = default(string)) + { + Tags = tags; + Sku = sku; + Description = description; + FriendlyName = friendlyName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource tags for the machine learning workspace. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the sku of the workspace. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + + /// + /// Gets or sets the description of this workspace. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets the friendly name for this workspace. + /// + [JsonProperty(PropertyName = "properties.friendlyName")] + public string FriendlyName { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/NotebooksOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/NotebooksOperations.cs new file mode 100644 index 0000000000000..3f2a9c21e4f64 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/NotebooksOperations.cs @@ -0,0 +1,261 @@ +// +// 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.MachineLearningServices +{ + 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; + + /// + /// NotebooksOperations operations. + /// + internal partial class NotebooksOperations : IServiceOperations, INotebooksOperations + { + /// + /// Initializes a new instance of the NotebooksOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NotebooksOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> PrepareWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginPrepareWithHttpMessagesAsync(resourceGroupName, workspaceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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> BeginPrepareWithHttpMessagesAsync(string resourceGroupName, string workspaceName, 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 (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginPrepare", 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.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + 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("POST"); + _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 && (int)_statusCode != 202) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/NotebooksOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/NotebooksOperationsExtensions.cs new file mode 100644 index 0000000000000..dbf015c8d793a --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/NotebooksOperationsExtensions.cs @@ -0,0 +1,93 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NotebooksOperations. + /// + public static partial class NotebooksOperationsExtensions + { + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static NotebookResourceInfo Prepare(this INotebooksOperations operations, string resourceGroupName, string workspaceName) + { + return operations.PrepareAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task PrepareAsync(this INotebooksOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PrepareWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static NotebookResourceInfo BeginPrepare(this INotebooksOperations operations, string resourceGroupName, string workspaceName) + { + return operations.BeginPrepareAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task BeginPrepareAsync(this INotebooksOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginPrepareWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Operations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Operations.cs new file mode 100644 index 0000000000000..c11e6555fda2b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Operations.cs @@ -0,0 +1,223 @@ +// +// 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.MachineLearningServices +{ + 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; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Lists all of the available Azure Machine Learning Workspaces REST API + /// 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.MachineLearningServices/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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/OperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/OperationsExtensions.cs new file mode 100644 index 0000000000000..08e4338586b43 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/OperationsExtensions.cs @@ -0,0 +1,57 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available Azure Machine Learning Workspaces REST API + /// operations. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available Azure Machine Learning Workspaces REST API + /// operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperations.cs new file mode 100644 index 0000000000000..3701e3c2876cd --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -0,0 +1,680 @@ +// +// 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.MachineLearningServices +{ + 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; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + internal partial class PrivateEndpointConnectionsOperations : IServiceOperations, IPrivateEndpointConnectionsOperations + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateEndpointConnectionsOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Gets the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// 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 workspaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + 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.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Update the state of specified private endpoint connection associated with + /// the workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// The private endpoint connection properties. + /// + /// + /// 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> PutWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string privateEndpointConnectionName, PrivateEndpointConnection properties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (properties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "properties"); + } + if (properties != null) + { + properties.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("properties", properties); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Put", 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.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + 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(properties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(properties, 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) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Deletes the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// 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 workspaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + 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.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + 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 != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs new file mode 100644 index 0000000000000..9f5ceb849eaf9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -0,0 +1,217 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateEndpointConnectionsOperations. + /// + public static partial class PrivateEndpointConnectionsOperationsExtensions + { + /// + /// Gets the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName) + { + return operations.GetAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the state of specified private endpoint connection associated with + /// the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// The private endpoint connection properties. + /// + public static PrivateEndpointConnection Put(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, PrivateEndpointConnection properties) + { + return operations.PutAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, properties).GetAwaiter().GetResult(); + } + + /// + /// Update the state of specified private endpoint connection associated with + /// the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// The private endpoint connection properties. + /// + /// + /// The cancellation token. + /// + public static async Task PutAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, PrivateEndpointConnection properties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PutWithHttpMessagesAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, properties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + public static void Delete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deletes the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + public static void BeginDelete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName) + { + operations.BeginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperations.cs new file mode 100644 index 0000000000000..2011bbd6c332c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperations.cs @@ -0,0 +1,250 @@ +// +// 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.MachineLearningServices +{ + 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; + + /// + /// PrivateLinkResourcesOperations operations. + /// + internal partial class PrivateLinkResourcesOperations : IServiceOperations, IPrivateLinkResourcesOperations + { + /// + /// Initializes a new instance of the PrivateLinkResourcesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateLinkResourcesOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Gets the private link resources that need to be created for a workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", 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.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + 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; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperationsExtensions.cs new file mode 100644 index 0000000000000..8b21778d1a1ba --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperationsExtensions.cs @@ -0,0 +1,65 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateLinkResourcesOperations. + /// + public static partial class PrivateLinkResourcesOperationsExtensions + { + /// + /// Gets the private link resources that need to be created for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static PrivateLinkResourceListResult ListByWorkspace(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link resources that need to be created for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task ListByWorkspaceAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperations.cs new file mode 100644 index 0000000000000..a291d7f2f064b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperations.cs @@ -0,0 +1,624 @@ +// +// 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.MachineLearningServices +{ + 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; + + /// + /// QuotasOperations operations. + /// + internal partial class QuotasOperations : IServiceOperations, IQuotasOperations + { + /// + /// Initializes a new instance of the QuotasOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal QuotasOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Update quota for each VM family in workspace. + /// + /// + /// The location for update quota is queried. + /// + /// + /// Quota update parameters. + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string location, QuotaUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + 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("location", location); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _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("POST"); + _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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// 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(string location, 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 (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + 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.MachineLearningServices/locations/{location}/Quotas").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + 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; + } + + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperationsExtensions.cs new file mode 100644 index 0000000000000..fafdf2338eb45 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperationsExtensions.cs @@ -0,0 +1,133 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for QuotasOperations. + /// + public static partial class QuotasOperationsExtensions + { + /// + /// Update quota for each VM family in workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for update quota is queried. + /// + /// + /// Quota update parameters. + /// + public static UpdateWorkspaceQuotasResult Update(this IQuotasOperations operations, string location, QuotaUpdateParameters parameters) + { + return operations.UpdateAsync(location, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update quota for each VM family in workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for update quota is queried. + /// + /// + /// Quota update parameters. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IQuotasOperations operations, string location, QuotaUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for which resource usage is queried. + /// + public static IPage List(this IQuotasOperations operations, string location) + { + return operations.ListAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IQuotasOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IQuotasOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// 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 IQuotasOperations 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/SdkInfo_AzureMachineLearningWorkspaces.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/SdkInfo_AzureMachineLearningWorkspaces.cs new file mode 100644 index 0000000000000..bc6625c5f6a37 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/SdkInfo_AzureMachineLearningWorkspaces.cs @@ -0,0 +1,38 @@ + +// +// 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.MachineLearningServices +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_AzureMachineLearningWorkspaces + { + get + { + return new Tuple[] + { + new Tuple("MachineLearningServices", "ListSkus", "2020-06-01"), + new Tuple("MachineLearningServices", "MachineLearningCompute", "2020-06-01"), + new Tuple("MachineLearningServices", "Notebooks", "2020-06-01"), + new Tuple("MachineLearningServices", "Operations", "2020-06-01"), + new Tuple("MachineLearningServices", "PrivateEndpointConnections", "2020-06-01"), + new Tuple("MachineLearningServices", "PrivateLinkResources", "2020-06-01"), + new Tuple("MachineLearningServices", "Quotas", "2020-06-01"), + new Tuple("MachineLearningServices", "Usages", "2020-06-01"), + new Tuple("MachineLearningServices", "VirtualMachineSizes", "2020-06-01"), + new Tuple("MachineLearningServices", "WorkspaceConnections", "2020-06-01"), + new Tuple("MachineLearningServices", "WorkspaceFeatures", "2020-06-01"), + new Tuple("MachineLearningServices", "Workspaces", "2020-06-01"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperations.cs new file mode 100644 index 0000000000000..3fbe0d02add21 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperations.cs @@ -0,0 +1,423 @@ +// +// 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.MachineLearningServices +{ + 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; + + /// + /// UsagesOperations operations. + /// + internal partial class UsagesOperations : IServiceOperations, IUsagesOperations + { + /// + /// Initializes a new instance of the UsagesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal UsagesOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Gets the current usage information as well as limits for AML resources for + /// given subscription and location. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// 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(string location, 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 (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + 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.MachineLearningServices/locations/{location}/usages").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + 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; + } + + /// + /// Gets the current usage information as well as limits for AML resources for + /// given subscription and location. + /// + /// + /// 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperationsExtensions.cs new file mode 100644 index 0000000000000..f3fbb71e7a9b8 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperationsExtensions.cs @@ -0,0 +1,97 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for UsagesOperations. + /// + public static partial class UsagesOperationsExtensions + { + /// + /// Gets the current usage information as well as limits for AML resources for + /// given subscription and location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for which resource usage is queried. + /// + public static IPage List(this IUsagesOperations operations, string location) + { + return operations.ListAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Gets the current usage information as well as limits for AML resources for + /// given subscription and location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IUsagesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the current usage information as well as limits for AML resources for + /// given subscription and location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IUsagesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the current usage information as well as limits for AML resources for + /// given subscription and location. + /// + /// + /// 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 IUsagesOperations 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperations.cs new file mode 100644 index 0000000000000..e51e45035556f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperations.cs @@ -0,0 +1,248 @@ +// +// 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.MachineLearningServices +{ + 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; + + /// + /// VirtualMachineSizesOperations operations. + /// + internal partial class VirtualMachineSizesOperations : IServiceOperations, IVirtualMachineSizesOperations + { + /// + /// Initializes a new instance of the VirtualMachineSizesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal VirtualMachineSizesOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Returns supported VM Sizes in a location + /// + /// + /// The location upon which virtual-machine-sizes is queried. + /// + /// + /// 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(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); + } + } + 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("location", location); + 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.MachineLearningServices/locations/{location}/vmSizes").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _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; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperationsExtensions.cs new file mode 100644 index 0000000000000..d6b5f57d895ea --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperationsExtensions.cs @@ -0,0 +1,59 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for VirtualMachineSizesOperations. + /// + public static partial class VirtualMachineSizesOperationsExtensions + { + /// + /// Returns supported VM Sizes in a location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location upon which virtual-machine-sizes is queried. + /// + public static VirtualMachineSizeListResult List(this IVirtualMachineSizesOperations operations, string location) + { + return operations.ListAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Returns supported VM Sizes in a location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location upon which virtual-machine-sizes is queried. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IVirtualMachineSizesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceConnectionsOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceConnectionsOperations.cs new file mode 100644 index 0000000000000..3987b132d5809 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceConnectionsOperations.cs @@ -0,0 +1,854 @@ +// +// 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.MachineLearningServices +{ + 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; + + /// + /// WorkspaceConnectionsOperations operations. + /// + internal partial class WorkspaceConnectionsOperations : IServiceOperations, IWorkspaceConnectionsOperations + { + /// + /// Initializes a new instance of the WorkspaceConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspaceConnectionsOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// List all connections under a AML workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Target of the workspace connection. + /// + /// + /// Category of the workspace connection. + /// + /// + /// 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(string resourceGroupName, string workspaceName, string target = default(string), string category = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("target", target); + tracingParameters.Add("category", category); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (target != null) + { + _queryParameters.Add(string.Format("target={0}", System.Uri.EscapeDataString(target))); + } + if (category != null) + { + _queryParameters.Add(string.Format("category={0}", System.Uri.EscapeDataString(category))); + } + 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Add a new workspace connection. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The object for creating or updating a new workspace connection + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string connectionName, WorkspaceConnectionDto parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", 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.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + 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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Get the detail of a workspace connection. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// 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 workspaceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("connectionName", connectionName); + 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.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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 a workspace connection. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + 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 != 200 && (int)_statusCode != 204) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceConnectionsOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceConnectionsOperationsExtensions.cs new file mode 100644 index 0000000000000..89973b3fe511f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceConnectionsOperationsExtensions.cs @@ -0,0 +1,220 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspaceConnectionsOperations. + /// + public static partial class WorkspaceConnectionsOperationsExtensions + { + /// + /// List all connections under a AML workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Target of the workspace connection. + /// + /// + /// Category of the workspace connection. + /// + public static IEnumerable List(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string target = default(string), string category = default(string)) + { + return operations.ListAsync(resourceGroupName, workspaceName, target, category).GetAwaiter().GetResult(); + } + + /// + /// List all connections under a AML workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Target of the workspace connection. + /// + /// + /// Category of the workspace connection. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string target = default(string), string category = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, target, category, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Add a new workspace connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The object for creating or updating a new workspace connection + /// + public static WorkspaceConnection Create(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string connectionName, WorkspaceConnectionDto parameters) + { + return operations.CreateAsync(resourceGroupName, workspaceName, connectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Add a new workspace connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The object for creating or updating a new workspace connection + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string connectionName, WorkspaceConnectionDto parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, workspaceName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the detail of a workspace connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + public static WorkspaceConnection Get(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string connectionName) + { + return operations.GetAsync(resourceGroupName, workspaceName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Get the detail of a workspace connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, connectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a workspace connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + public static void Delete(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string connectionName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete a workspace connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperations.cs new file mode 100644 index 0000000000000..0481e0de14d1a --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperations.cs @@ -0,0 +1,413 @@ +// +// 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.MachineLearningServices +{ + 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; + + /// + /// WorkspaceFeaturesOperations operations. + /// + internal partial class WorkspaceFeaturesOperations : IServiceOperations, IWorkspaceFeaturesOperations + { + /// + /// Initializes a new instance of the WorkspaceFeaturesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspaceFeaturesOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Lists all enabled features for a workspace + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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(string resourceGroupName, string workspaceName, 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 (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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 enabled features for a workspace + /// + /// + /// 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperationsExtensions.cs new file mode 100644 index 0000000000000..9e4cbbb6d065b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperationsExtensions.cs @@ -0,0 +1,99 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspaceFeaturesOperations. + /// + public static partial class WorkspaceFeaturesOperationsExtensions + { + /// + /// Lists all enabled features for a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static IPage List(this IWorkspaceFeaturesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Lists all enabled features for a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWorkspaceFeaturesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all enabled features for a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IWorkspaceFeaturesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all enabled features for a workspace + /// + /// + /// 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 IWorkspaceFeaturesOperations 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperations.cs new file mode 100644 index 0000000000000..54946a5c51905 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperations.cs @@ -0,0 +1,1968 @@ +// +// 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.MachineLearningServices +{ + 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; + + /// + /// WorkspacesOperations operations. + /// + internal partial class WorkspacesOperations : IServiceOperations, IWorkspacesOperations + { + /// + /// Initializes a new instance of the WorkspacesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspacesOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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 workspaceName, 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 (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + 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.MachineLearningServices/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for updating a machine learning workspace. + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspaceUpdateParameters parameters, 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 (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", 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.MachineLearningServices/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + 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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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 machine learning workspaces under the specified + /// resource group. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Continuation token for pagination. + /// + /// + /// 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, string skiptoken = default(string), 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"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("skiptoken", skiptoken); + 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.MachineLearningServices/workspaces").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 (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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 keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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> ListKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, 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 (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListKeys", 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.MachineLearningServices/workspaces/{workspaceName}/listKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + 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("POST"); + _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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Resync all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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 ResyncKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, 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 (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ResyncKeys", 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.MachineLearningServices/workspaces/{workspaceName}/resyncKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + 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("POST"); + _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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// Continuation token for pagination. + /// + /// + /// 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>> ListBySubscriptionWithHttpMessagesAsync(string skiptoken = default(string), 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("skiptoken", skiptoken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces").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 (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + /// + /// 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 workspaceName, Workspace parameters, 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 (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("parameters", parameters); + 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.MachineLearningServices/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + 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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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 workspaceName, 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 (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + 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.MachineLearningServices/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + 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 != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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 machine learning workspaces under the specified + /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", 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 MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperationsExtensions.cs new file mode 100644 index 0000000000000..12db523f7871c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperationsExtensions.cs @@ -0,0 +1,508 @@ +// +// 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.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspacesOperations. + /// + public static partial class WorkspacesOperationsExtensions + { + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static Workspace Get(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.GetAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + public static Workspace CreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static void Delete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + operations.DeleteAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for updating a machine learning workspace. + /// + public static Workspace Update(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspaceUpdateParameters parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for updating a machine learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspaceUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Continuation token for pagination. + /// + public static IPage ListByResourceGroup(this IWorkspacesOperations operations, string resourceGroupName, string skiptoken = default(string)) + { + return operations.ListByResourceGroupAsync(resourceGroupName, skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Continuation token for pagination. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IWorkspacesOperations operations, string resourceGroupName, string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static ListWorkspaceKeysResult ListKeys(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListKeysAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task ListKeysAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Resync all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static void ResyncKeys(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + operations.ResyncKeysAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Resync all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task ResyncKeysAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ResyncKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Continuation token for pagination. + /// + public static IPage ListBySubscription(this IWorkspacesOperations operations, string skiptoken = default(string)) + { + return operations.ListBySubscriptionAsync(skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Continuation token for pagination. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IWorkspacesOperations operations, string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + public static Workspace BeginCreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static void BeginDelete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + operations.BeginDeleteAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IWorkspacesOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// 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 IWorkspacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this IWorkspacesOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// 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> ListBySubscriptionNextAsync(this IWorkspacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}