From bec52e047b93249ae2f5e9cd746d72ab9ea0509e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 7 Dec 2020 09:46:45 +0000 Subject: [PATCH] CodeGen from PR 11939 in Azure/azure-rest-api-specs [Hub Generated] Public private branch 'credscan-fix' (#11939) * Fix credscan * Fix more credentials --- .../AzureMLCommitmentPlansManagementClient.cs | 173 +- .../CommitmentAssociationsOperations.cs | 397 ++-- ...mitmentAssociationsOperationsExtensions.cs | 54 +- .../CommitmentPlansOperations.cs | 745 ++++--- .../CommitmentPlansOperationsExtensions.cs | 62 +- ...IAzureMLCommitmentPlansManagementClient.cs | 34 +- .../ICommitmentAssociationsOperations.cs | 28 +- .../ICommitmentPlansOperations.cs | 31 +- .../Generated/CommitmentPlans/IOperations.cs | 47 + .../CommitmentPlans/ISkusOperations.cs | 46 + .../IUsageHistoryOperations.cs | 19 +- .../CommitmentPlans/Models/CatalogSku.cs | 114 + .../Models/CommitmentAssociation.cs | 28 +- .../Models/CommitmentAssociationProperties.cs | 28 +- .../CommitmentPlans/Models/CommitmentPlan.cs | 30 +- .../Models/CommitmentPlanPatchPayload.cs | 28 +- .../Models/CommitmentPlanProperties.cs | 53 +- .../MoveCommitmentAssociationRequest.cs | 20 +- .../Models/OperationDisplayInfo.cs | 78 + .../CommitmentPlans/Models/OperationEntity.cs | 60 + .../Generated/CommitmentPlans/Models/Page.cs | 29 +- .../Generated/CommitmentPlans/Models/Page1.cs | 53 + .../CommitmentPlans/Models/PlanQuantity.cs | 26 +- .../Models/PlanUsageHistory.cs | 56 +- .../CommitmentPlans/Models/Resource.cs | 42 +- .../CommitmentPlans/Models/ResourceSku.cs | 36 +- .../ResourceSkuRestrictionsReasonCode.cs | 22 + .../Models/ResourceSkuRestrictionsType.cs | 22 + .../CommitmentPlans/Models/SkuCapability.cs | 59 + .../CommitmentPlans/Models/SkuCapacity.cs | 77 + .../Models/SkuCapacityScaleType.cs | 23 + .../CommitmentPlans/Models/SkuCost.cs | 69 + .../CommitmentPlans/Models/SkuRestrictions.cs | 77 + .../Generated/CommitmentPlans/Operations.cs | 228 ++ .../CommitmentPlans/OperationsExtensions.cs | 57 + ..._AzureMLCommitmentPlansManagementClient.cs | 31 + .../CommitmentPlans/SkusOperations.cs | 232 ++ .../SkusOperationsExtensions.cs | 55 + .../CommitmentPlans/UsageHistoryOperations.cs | 193 +- .../UsageHistoryOperationsExtensions.cs | 32 +- .../AzureMLWebServicesManagementClient.cs | 68 +- .../IAzureMLWebServicesManagementClient.cs | 27 +- .../src/Generated/WebServices/IOperations.cs | 46 + .../WebServices/IWebServicesOperations.cs | 15 +- .../Generated/WebServices/Models/AssetItem.cs | 14 +- .../Generated/WebServices/Models/AssetType.cs | 12 +- .../Models/AsyncOperationErrorInfo.cs | 30 +- .../Models/AsyncOperationStatus.cs | 32 +- .../WebServices/Models/BlobLocation.cs | 14 +- .../WebServices/Models/ColumnFormat.cs | 12 +- .../WebServices/Models/ColumnSpecification.cs | 14 +- .../WebServices/Models/ColumnType.cs | 12 +- .../WebServices/Models/CommitmentPlan.cs | 14 +- .../Models/DiagnosticsConfiguration.cs | 14 +- .../WebServices/Models/DiagnosticsLevel.cs | 12 +- .../WebServices/Models/ExampleRequest.cs | 14 +- .../Generated/WebServices/Models/GraphEdge.cs | 14 +- .../Generated/WebServices/Models/GraphNode.cs | 14 +- .../WebServices/Models/GraphPackage.cs | 14 +- .../WebServices/Models/GraphParameter.cs | 14 +- .../WebServices/Models/GraphParameterLink.cs | 14 +- .../Generated/WebServices/Models/InputPort.cs | 14 +- .../WebServices/Models/InputPortType.cs | 12 +- .../Models/MachineLearningWorkspace.cs | 14 +- .../WebServices/Models/ModeValueInfo.cs | 14 +- .../Models/ModuleAssetParameter.cs | 14 +- .../Models/OperationDisplayInfo.cs | 78 + .../WebServices/Models/OperationEntity.cs | 60 + .../WebServices/Models/OutputPort.cs | 14 +- .../WebServices/Models/OutputPortType.cs | 12 +- .../src/Generated/WebServices/Models/Page.cs | 14 +- .../src/Generated/WebServices/Models/Page1.cs | 53 + .../WebServices/Models/ParameterType.cs | 12 +- .../WebServices/Models/PatchedResource.cs | 89 + .../WebServices/Models/PatchedWebService.cs | 76 + .../WebServices/Models/ProvisioningState.cs | 12 +- .../Models/RealtimeConfiguration.cs | 14 +- .../Generated/WebServices/Models/Resource.cs | 14 +- .../Models/ServiceInputOutputSpecification.cs | 14 +- .../WebServices/Models/StorageAccount.cs | 14 +- .../WebServices/Models/TableSpecification.cs | 14 +- .../WebServices/Models/WebService.cs | 14 +- .../WebServices/Models/WebServiceKeys.cs | 14 +- .../WebServices/Models/WebServiceParameter.cs | 14 +- .../Models/WebServiceProperties.cs | 18 +- .../Models/WebServicePropertiesForGraph.cs | 16 +- .../src/Generated/WebServices/Operations.cs | 227 ++ .../WebServices/OperationsExtensions.cs | 55 + ...Info_AzureMLWebServicesManagementClient.cs | 28 + .../WebServices/WebServicesOperations.cs | 25 +- .../WebServicesOperationsExtensions.cs | 19 +- ...chineLearningWorkspacesManagementClient.cs | 85 + .../src/Generated/Workspaces/IOperations.cs | 47 + .../Workspaces/IWorkspacesOperations.cs | 274 +++ ...chineLearningWorkspacesManagementClient.cs | 368 ++++ .../Workspaces/Models/ErrorResponse.cs | 77 + .../Models/ErrorResponseException.cs | 62 + .../Generated/Workspaces/Models/Operation.cs | 60 + .../Workspaces/Models/OperationDisplay.cs | 79 + .../src/Generated/Workspaces/Models/Page.cs | 53 + .../src/Generated/Workspaces/Models/Page1.cs | 53 + .../Generated/Workspaces/Models/Resource.cs | 102 + .../Generated/Workspaces/Models/Workspace.cs | 154 ++ .../Models/WorkspaceKeysResponse.cs | 61 + .../Workspaces/Models/WorkspaceState.cs | 90 + .../Workspaces/Models/WorkspaceType.cs | 78 + .../Models/WorkspaceUpdateParameters.cs | 80 + .../src/Generated/Workspaces/Operations.cs | 223 ++ .../Workspaces/OperationsExtensions.cs | 57 + ...chineLearningWorkspacesManagementClient.cs | 28 + .../Workspaces/WorkspacesOperations.cs | 1892 +++++++++++++++++ .../WorkspacesOperationsExtensions.cs | 423 ++++ 112 files changed, 8078 insertions(+), 1170 deletions(-) create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IOperations.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ISkusOperations.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CatalogSku.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationDisplayInfo.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationEntity.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page1.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsReasonCode.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsType.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapability.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacity.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacityScaleType.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCost.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuRestrictions.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Operations.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/OperationsExtensions.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SdkInfo_AzureMLCommitmentPlansManagementClient.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperations.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperationsExtensions.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IOperations.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationDisplayInfo.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationEntity.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page1.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedResource.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedWebService.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Operations.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/OperationsExtensions.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/SdkInfo_AzureMLWebServicesManagementClient.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IMachineLearningWorkspacesManagementClient.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IOperations.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IWorkspacesOperations.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/MachineLearningWorkspacesManagementClient.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponse.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponseException.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Operation.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/OperationDisplay.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Page.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Page1.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Resource.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Workspace.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceKeysResponse.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceState.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceType.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceUpdateParameters.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Operations.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/OperationsExtensions.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/SdkInfo_MachineLearningWorkspacesManagementClient.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperations.cs create mode 100644 sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperationsExtensions.cs diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/AzureMLCommitmentPlansManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/AzureMLCommitmentPlansManagementClient.cs index 8443abc0cdc68..cc2a7be383015 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/AzureMLCommitmentPlansManagementClient.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/AzureMLCommitmentPlansManagementClient.cs @@ -1,17 +1,25 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans { - using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; /// /// These APIs allow end users to operate on Azure Machine Learning @@ -21,7 +29,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans /// associations between commitment plans, and retrieving commitment plan /// usage history. /// - public partial class AzureMLCommitmentPlansManagementClient : Microsoft.Rest.ServiceClient, IAzureMLCommitmentPlansManagementClient, IAzureClient + public partial class AzureMLCommitmentPlansManagementClient : ServiceClient, IAzureMLCommitmentPlansManagementClient, IAzureClient { /// /// The base URI of the service. @@ -31,17 +39,17 @@ public partial class AzureMLCommitmentPlansManagementClient : Microsoft.Rest.Ser /// /// Gets or sets json serialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } + public JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } + public JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } + public ServiceClientCredentials Credentials { get; private set; } /// /// Azure Subscription ID. @@ -54,22 +62,33 @@ public partial class AzureMLCommitmentPlansManagementClient : Microsoft.Rest.Ser public string ApiVersion { get; private set; } /// - /// Gets or sets the preferred language for the response. + /// The preferred language for the response. /// public string AcceptLanguage { get; set; } /// - /// Gets or sets the retry timeout in seconds for Long Running Operations. - /// Default value is 30. + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. /// public int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. /// public bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the ISkusOperations. + /// + public virtual ISkusOperations Skus { get; private set; } + /// /// Gets the ICommitmentAssociationsOperations. /// @@ -85,15 +104,28 @@ public partial class AzureMLCommitmentPlansManagementClient : Microsoft.Rest.Ser /// public virtual IUsageHistoryOperations UsageHistory { get; private set; } + /// + /// Initializes a new instance of the AzureMLCommitmentPlansManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureMLCommitmentPlansManagementClient.Dispose(). False: will not dispose provided httpClient + protected AzureMLCommitmentPlansManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + /// /// Initializes a new instance of the AzureMLCommitmentPlansManagementClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected AzureMLCommitmentPlansManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) + protected AzureMLCommitmentPlansManagementClient(params DelegatingHandler[] handlers) : base(handlers) { - this.Initialize(); + Initialize(); } /// @@ -105,9 +137,9 @@ protected AzureMLCommitmentPlansManagementClient(params System.Net.Http.Delegati /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected AzureMLCommitmentPlansManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected AzureMLCommitmentPlansManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { - this.Initialize(); + Initialize(); } /// @@ -122,13 +154,13 @@ protected AzureMLCommitmentPlansManagementClient(System.Net.Http.HttpClientHandl /// /// Thrown when a required parameter is null /// - protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -146,13 +178,13 @@ protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, params Syst /// /// Thrown when a required parameter is null /// - protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -167,16 +199,43 @@ protected AzureMLCommitmentPlansManagementClient(System.Uri baseUri, System.Net. /// /// Thrown when a required parameter is null /// - public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public AzureMLCommitmentPlansManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the AzureMLCommitmentPlansManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureMLCommitmentPlansManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public AzureMLCommitmentPlansManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); } } @@ -195,16 +254,16 @@ public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCreden /// /// Thrown when a required parameter is null /// - public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public AzureMLCommitmentPlansManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -223,7 +282,7 @@ public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCreden /// /// Thrown when a required parameter is null /// - public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -233,11 +292,11 @@ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -259,7 +318,7 @@ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest /// /// Thrown when a required parameter is null /// - public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -269,11 +328,11 @@ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -286,41 +345,43 @@ public AzureMLCommitmentPlansManagementClient(System.Uri baseUri, Microsoft.Rest /// private void Initialize() { - this.CommitmentAssociations = new CommitmentAssociationsOperations(this); - this.CommitmentPlans = new CommitmentPlansOperations(this); - this.UsageHistory = new UsageHistoryOperations(this); - this.BaseUri = new System.Uri("https://management.azure.com"); - this.ApiVersion = "2016-05-01-preview"; - this.AcceptLanguage = "en-US"; - this.LongRunningOperationRetryTimeout = 30; - this.GenerateClientRequestId = true; - SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings + Operations = new Operations(this); + Skus = new SkusOperations(this); + CommitmentAssociations = new CommitmentAssociationsOperations(this); + CommitmentPlans = new CommitmentPlansOperations(this); + UsageHistory = new UsageHistoryOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2016-05-01-preview"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; - DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings + DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); - } + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperations.cs index d9d3b89dc083c..744628259c4ca 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperations.cs @@ -1,22 +1,31 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans { - using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// CommitmentAssociationsOperations operations. /// - internal partial class CommitmentAssociationsOperations : Microsoft.Rest.IServiceOperations, ICommitmentAssociationsOperations + internal partial class CommitmentAssociationsOperations : IServiceOperations, ICommitmentAssociationsOperations { /// /// Initializes a new instance of the CommitmentAssociationsOperations class. @@ -29,11 +38,11 @@ internal partial class CommitmentAssociationsOperations : Microsoft.Rest.IServic /// internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -42,7 +51,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient public AzureMLCommitmentPlansManagementClient Client { get; private set; } /// - /// Gets a commitment association. + /// Get a commitment association. /// /// /// The resource group name. @@ -59,87 +68,92 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } if (commitmentAssociationName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentAssociationName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentAssociationName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("commitmentAssociationName", commitmentAssociationName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations/{commitmentAssociationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); _url = _url.Replace("{commitmentAssociationName}", System.Uri.EscapeDataString(commitmentAssociationName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -155,51 +169,51 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -209,7 +223,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -222,21 +236,21 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -259,86 +273,91 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -354,51 +373,51 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -408,7 +427,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -421,27 +440,27 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Re-parents a commitment association from one commitment plan to another. + /// Re-parent a commitment association from one commitment plan to another. /// /// /// The resource group name. @@ -452,8 +471,9 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient /// /// The commitment association name. /// - /// - /// The move request payload. + /// + /// The ARM ID of the commitment plan to re-parent the commitment association + /// to. /// /// /// Headers that will be added to request. @@ -461,92 +481,98 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> MoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, MoveCommitmentAssociationRequest movePayload, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> MoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, string destinationPlanId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } if (commitmentAssociationName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentAssociationName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentAssociationName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (movePayload == null) + MoveCommitmentAssociationRequest movePayload = new MoveCommitmentAssociationRequest(); + if (destinationPlanId != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "movePayload"); + movePayload.DestinationPlanId = destinationPlanId; } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("commitmentAssociationName", commitmentAssociationName); tracingParameters.Add("movePayload", movePayload); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Move", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Move", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations/{commitmentAssociationName}/move").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); _url = _url.Replace("{commitmentAssociationName}", System.Uri.EscapeDataString(commitmentAssociationName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -563,56 +589,56 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient string _requestContent = null; if(movePayload != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(movePayload, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(movePayload, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -622,7 +648,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -635,21 +661,21 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -666,61 +692,66 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -736,51 +767,51 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -790,7 +821,7 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -803,21 +834,21 @@ internal CommitmentAssociationsOperations(AzureMLCommitmentPlansManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperationsExtensions.cs index b179ecb7926f9..4de4ae1a3247a 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperationsExtensions.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentAssociationsOperationsExtensions.cs @@ -1,16 +1,20 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans { + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for CommitmentAssociationsOperations. @@ -18,7 +22,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans public static partial class CommitmentAssociationsOperationsExtensions { /// - /// Gets a commitment association. + /// Get a commitment association. /// /// /// The operations group for this extension method. @@ -34,11 +38,11 @@ public static partial class CommitmentAssociationsOperationsExtensions /// public static CommitmentAssociation Get(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentAssociationsOperations)s).GetAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName).GetAwaiter().GetResult(); } /// - /// Gets a commitment association. + /// Get a commitment association. /// /// /// The operations group for this extension method. @@ -55,7 +59,7 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, null, cancellationToken).ConfigureAwait(false)) { @@ -78,9 +82,9 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o /// /// Continuation token for pagination. /// - public static Microsoft.Rest.Azure.IPage List(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string)) + public static IPage List(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentAssociationsOperations)s).ListAsync(resourceGroupName, commitmentPlanName, skipToken), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, commitmentPlanName, skipToken).GetAwaiter().GetResult(); } /// @@ -101,7 +105,7 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o /// /// The cancellation token. /// - public static async Task> ListAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, skipToken, null, cancellationToken).ConfigureAwait(false)) { @@ -110,7 +114,7 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o } /// - /// Re-parents a commitment association from one commitment plan to another. + /// Re-parent a commitment association from one commitment plan to another. /// /// /// The operations group for this extension method. @@ -124,16 +128,17 @@ public static CommitmentAssociation Get(this ICommitmentAssociationsOperations o /// /// The commitment association name. /// - /// - /// The move request payload. + /// + /// The ARM ID of the commitment plan to re-parent the commitment association + /// to. /// - public static CommitmentAssociation Move(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, MoveCommitmentAssociationRequest movePayload) + public static CommitmentAssociation Move(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, string destinationPlanId = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentAssociationsOperations)s).MoveAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, movePayload), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.MoveAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, destinationPlanId).GetAwaiter().GetResult(); } /// - /// Re-parents a commitment association from one commitment plan to another. + /// Re-parent a commitment association from one commitment plan to another. /// /// /// The operations group for this extension method. @@ -147,15 +152,16 @@ public static CommitmentAssociation Move(this ICommitmentAssociationsOperations /// /// The commitment association name. /// - /// - /// The move request payload. + /// + /// The ARM ID of the commitment plan to re-parent the commitment association + /// to. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MoveAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, MoveCommitmentAssociationRequest movePayload, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task MoveAsync(this ICommitmentAssociationsOperations operations, string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, string destinationPlanId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.MoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, movePayload, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, commitmentAssociationName, destinationPlanId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -170,9 +176,9 @@ public static CommitmentAssociation Move(this ICommitmentAssociationsOperations /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this ICommitmentAssociationsOperations operations, string nextPageLink) + public static IPage ListNext(this ICommitmentAssociationsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentAssociationsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -187,7 +193,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IC /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ICommitmentAssociationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this ICommitmentAssociationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperations.cs index 3a1fbcc7de82a..0d72a8a4696ee 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperations.cs @@ -1,22 +1,31 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans { - using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// CommitmentPlansOperations operations. /// - internal partial class CommitmentPlansOperations : Microsoft.Rest.IServiceOperations, ICommitmentPlansOperations + internal partial class CommitmentPlansOperations : IServiceOperations, ICommitmentPlansOperations { /// /// Initializes a new instance of the CommitmentPlansOperations class. @@ -29,11 +38,11 @@ internal partial class CommitmentPlansOperations : Microsoft.Rest.IServiceOperat /// internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -57,81 +66,86 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -147,51 +161,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -201,7 +215,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -214,27 +228,27 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates a new Azure ML commitment plan resource or updates an existing one. + /// Create a new Azure ML commitment plan resource or updates an existing one. /// /// /// The payload to create or update the Azure ML commitment plan. @@ -251,90 +265,95 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (createOrUpdatePayload == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createOrUpdatePayload"); + throw new ValidationException(ValidationRules.CannotBeNull, "createOrUpdatePayload"); } if (createOrUpdatePayload != null) { createOrUpdatePayload.Validate(); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("createOrUpdatePayload", createOrUpdatePayload); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -351,56 +370,56 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client string _requestContent = null; if(createOrUpdatePayload != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createOrUpdatePayload, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(createOrUpdatePayload, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -410,7 +429,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -423,16 +442,16 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -441,21 +460,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -475,78 +494,83 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task RemoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task RemoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Remove", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Remove", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -562,43 +586,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -608,7 +640,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -617,7 +649,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -626,7 +658,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// Patch an existing Azure ML commitment plan resource. /// /// - /// The payload to patch the Azure ML commitment plan with. Only tags and SKU + /// The payload to use to patch the Azure ML commitment plan. Only tags and SKU /// may be modified on an existing commitment plan. /// /// @@ -641,86 +673,91 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> PatchWithHttpMessagesAsync(CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (patchPayload == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "patchPayload"); + throw new ValidationException(ValidationRules.CannotBeNull, "patchPayload"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("patchPayload", patchPayload); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -737,56 +774,56 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client string _requestContent = null; if(patchPayload != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(patchPayload, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(patchPayload, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -796,7 +833,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -809,21 +846,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -840,74 +877,79 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/commitmentPlans").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -923,51 +965,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -977,7 +1019,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -990,21 +1032,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1024,80 +1066,85 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListInResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListInResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListInResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1113,51 +1160,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1167,7 +1214,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1180,21 +1227,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1211,61 +1258,66 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1281,51 +1333,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1335,7 +1387,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1348,21 +1400,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1379,61 +1431,66 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListInResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1449,51 +1506,51 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1503,7 +1560,7 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1516,21 +1573,21 @@ internal CommitmentPlansOperations(AzureMLCommitmentPlansManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperationsExtensions.cs index 2b6416b5e2765..efaa27437d725 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperationsExtensions.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/CommitmentPlansOperationsExtensions.cs @@ -1,16 +1,20 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans { + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for CommitmentPlansOperations. @@ -32,7 +36,7 @@ public static partial class CommitmentPlansOperationsExtensions /// public static CommitmentPlan Get(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).GetAsync(resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, commitmentPlanName).GetAwaiter().GetResult(); } /// @@ -51,7 +55,7 @@ public static CommitmentPlan Get(this ICommitmentPlansOperations operations, str /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false)) { @@ -60,7 +64,7 @@ public static CommitmentPlan Get(this ICommitmentPlansOperations operations, str } /// - /// Creates a new Azure ML commitment plan resource or updates an existing one. + /// Create a new Azure ML commitment plan resource or updates an existing one. /// /// /// The operations group for this extension method. @@ -76,11 +80,11 @@ public static CommitmentPlan Get(this ICommitmentPlansOperations operations, str /// public static CommitmentPlan CreateOrUpdate(this ICommitmentPlansOperations operations, CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).CreateOrUpdateAsync(createOrUpdatePayload, resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(createOrUpdatePayload, resourceGroupName, commitmentPlanName).GetAwaiter().GetResult(); } /// - /// Creates a new Azure ML commitment plan resource or updates an existing one. + /// Create a new Azure ML commitment plan resource or updates an existing one. /// /// /// The operations group for this extension method. @@ -97,7 +101,7 @@ public static CommitmentPlan CreateOrUpdate(this ICommitmentPlansOperations oper /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ICommitmentPlansOperations operations, CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this ICommitmentPlansOperations operations, CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(createOrUpdatePayload, resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false)) { @@ -119,7 +123,7 @@ public static CommitmentPlan CreateOrUpdate(this ICommitmentPlansOperations oper /// public static void Remove(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).RemoveAsync(resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.RemoveAsync(resourceGroupName, commitmentPlanName).GetAwaiter().GetResult(); } /// @@ -137,9 +141,9 @@ public static void Remove(this ICommitmentPlansOperations operations, string res /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RemoveAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task RemoveAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.RemoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false); + (await operations.RemoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -149,7 +153,7 @@ public static void Remove(this ICommitmentPlansOperations operations, string res /// The operations group for this extension method. /// /// - /// The payload to patch the Azure ML commitment plan with. Only tags and SKU + /// The payload to use to patch the Azure ML commitment plan. Only tags and SKU /// may be modified on an existing commitment plan. /// /// @@ -160,7 +164,7 @@ public static void Remove(this ICommitmentPlansOperations operations, string res /// public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).PatchAsync(patchPayload, resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.PatchAsync(patchPayload, resourceGroupName, commitmentPlanName).GetAwaiter().GetResult(); } /// @@ -170,7 +174,7 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// The operations group for this extension method. /// /// - /// The payload to patch the Azure ML commitment plan with. Only tags and SKU + /// The payload to use to patch the Azure ML commitment plan. Only tags and SKU /// may be modified on an existing commitment plan. /// /// @@ -182,7 +186,7 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task PatchAsync(this ICommitmentPlansOperations operations, CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task PatchAsync(this ICommitmentPlansOperations operations, CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PatchWithHttpMessagesAsync(patchPayload, resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false)) { @@ -199,9 +203,9 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// /// Continuation token for pagination. /// - public static Microsoft.Rest.Azure.IPage List(this ICommitmentPlansOperations operations, string skipToken = default(string)) + public static IPage List(this ICommitmentPlansOperations operations, string skipToken = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListAsync(skipToken), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(skipToken).GetAwaiter().GetResult(); } /// @@ -216,7 +220,7 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// /// The cancellation token. /// - public static async Task> ListAsync(this ICommitmentPlansOperations operations, string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this ICommitmentPlansOperations operations, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(skipToken, null, cancellationToken).ConfigureAwait(false)) { @@ -236,9 +240,9 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// /// Continuation token for pagination. /// - public static Microsoft.Rest.Azure.IPage ListInResourceGroup(this ICommitmentPlansOperations operations, string resourceGroupName, string skipToken = default(string)) + public static IPage ListInResourceGroup(this ICommitmentPlansOperations operations, string resourceGroupName, string skipToken = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListInResourceGroupAsync(resourceGroupName, skipToken), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListInResourceGroupAsync(resourceGroupName, skipToken).GetAwaiter().GetResult(); } /// @@ -256,7 +260,7 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// /// The cancellation token. /// - public static async Task> ListInResourceGroupAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListInResourceGroupAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListInResourceGroupWithHttpMessagesAsync(resourceGroupName, skipToken, null, cancellationToken).ConfigureAwait(false)) { @@ -273,9 +277,9 @@ public static CommitmentPlan Patch(this ICommitmentPlansOperations operations, C /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this ICommitmentPlansOperations operations, string nextPageLink) + public static IPage ListNext(this ICommitmentPlansOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -290,7 +294,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ICommitme /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -307,9 +311,9 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ICommitme /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListInResourceGroupNext(this ICommitmentPlansOperations operations, string nextPageLink) + public static IPage ListInResourceGroupNext(this ICommitmentPlansOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListInResourceGroupNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListInResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -324,7 +328,7 @@ public static Microsoft.Rest.Azure.IPage ListInResourceGroupNext /// /// The cancellation token. /// - public static async Task> ListInResourceGroupNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListInResourceGroupNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListInResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IAzureMLCommitmentPlansManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IAzureMLCommitmentPlansManagementClient.cs index aadd13efaa2ea..72a5b494e1bda 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IAzureMLCommitmentPlansManagementClient.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IAzureMLCommitmentPlansManagementClient.cs @@ -1,16 +1,19 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using Newtonsoft.Json; /// /// These APIs allow end users to operate on Azure Machine Learning @@ -30,17 +33,17 @@ public partial interface IAzureMLCommitmentPlansManagementClient : System.IDispo /// /// Gets or sets json serialization settings. /// - Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } + JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } + JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - Microsoft.Rest.ServiceClientCredentials Credentials { get; } + ServiceClientCredentials Credentials { get; } /// /// Azure Subscription ID. @@ -54,23 +57,34 @@ public partial interface IAzureMLCommitmentPlansManagementClient : System.IDispo string ApiVersion { get; } /// - /// Gets or sets the preferred language for the response. + /// The preferred language for the response. /// string AcceptLanguage { get; set; } /// - /// Gets or sets the retry timeout in seconds for Long Running - /// Operations. Default value is 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. /// int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is - /// generated and included in each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. /// bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the ISkusOperations. + /// + ISkusOperations Skus { get; } + /// /// Gets the ICommitmentAssociationsOperations. /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentAssociationsOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentAssociationsOperations.cs index e0adc9674072a..c63328bccda6c 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentAssociationsOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentAssociationsOperations.cs @@ -1,15 +1,22 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// CommitmentAssociationsOperations operations. @@ -17,7 +24,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans public partial interface ICommitmentAssociationsOperations { /// - /// Gets a commitment association. + /// Get a commitment association. /// /// /// The resource group name. @@ -43,7 +50,7 @@ public partial interface ICommitmentAssociationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all commitment associations for a parent commitment plan. /// @@ -71,9 +78,9 @@ public partial interface ICommitmentAssociationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Re-parents a commitment association from one commitment plan to + /// Re-parent a commitment association from one commitment plan to /// another. /// /// @@ -85,8 +92,9 @@ public partial interface ICommitmentAssociationsOperations /// /// The commitment association name. /// - /// - /// The move request payload. + /// + /// The ARM ID of the commitment plan to re-parent the commitment + /// association to. /// /// /// The headers that will be added to request. @@ -103,7 +111,7 @@ public partial interface ICommitmentAssociationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> MoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, MoveCommitmentAssociationRequest movePayload, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> MoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string commitmentAssociationName, string destinationPlanId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all commitment associations for a parent commitment plan. /// @@ -125,6 +133,6 @@ public partial interface ICommitmentAssociationsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentPlansOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentPlansOperations.cs index 94ec75d951cf2..846202f2fd558 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentPlansOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ICommitmentPlansOperations.cs @@ -1,15 +1,22 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// CommitmentPlansOperations operations. @@ -41,9 +48,9 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a new Azure ML commitment plan resource or updates an + /// Create a new Azure ML commitment plan resource or updates an /// existing one. /// /// @@ -70,7 +77,7 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Remove an existing Azure ML commitment plan. /// @@ -92,12 +99,12 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task RemoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task RemoveWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Patch an existing Azure ML commitment plan resource. /// /// - /// The payload to patch the Azure ML commitment plan with. Only tags + /// The payload to use to patch the Azure ML commitment plan. Only tags /// and SKU may be modified on an existing commitment plan. /// /// @@ -121,7 +128,7 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> PatchWithHttpMessagesAsync(CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PatchWithHttpMessagesAsync(CommitmentPlanPatchPayload patchPayload, string resourceGroupName, string commitmentPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve all Azure ML commitment plans in a subscription. /// @@ -143,7 +150,7 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve all Azure ML commitment plans in a resource group. /// @@ -168,7 +175,7 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListInResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListInResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve all Azure ML commitment plans in a subscription. /// @@ -190,7 +197,7 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve all Azure ML commitment plans in a resource group. /// @@ -212,6 +219,6 @@ public partial interface ICommitmentPlansOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IOperations.cs new file mode 100644 index 0000000000000..9f0a68a88fca5 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/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.MachineLearning.CommitmentPlans +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available Azure Machine Learning Studio Commitment + /// Plan RP 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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ISkusOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ISkusOperations.cs new file mode 100644 index 0000000000000..9028d6af4a85f --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/ISkusOperations.cs @@ -0,0 +1,46 @@ +// +// 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.MachineLearning.CommitmentPlans +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SkusOperations operations. + /// + public partial interface ISkusOperations + { + /// + /// Lists the available commitment plan SKUs. + /// + /// + /// 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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IUsageHistoryOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IUsageHistoryOperations.cs index 4a82b5add85ec..3ffd0ccec6267 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IUsageHistoryOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/IUsageHistoryOperations.cs @@ -1,15 +1,22 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans { + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// UsageHistoryOperations operations. @@ -17,7 +24,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans public partial interface IUsageHistoryOperations { /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The resource group name. @@ -43,9 +50,9 @@ public partial interface IUsageHistoryOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The NextLink from the previous successful call to List operation. @@ -65,6 +72,6 @@ public partial interface IUsageHistoryOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CatalogSku.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CatalogSku.cs new file mode 100644 index 0000000000000..e9a850bc92599 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CatalogSku.cs @@ -0,0 +1,114 @@ +// +// 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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Details of a commitment plan SKU. + /// + public partial class CatalogSku + { + /// + /// Initializes a new instance of the CatalogSku class. + /// + public CatalogSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CatalogSku class. + /// + /// Resource type name + /// SKU name + /// SKU tier + /// Regions where the SKU is available. + /// SKU scaling information + /// The capability information for the + /// specified SKU. + /// The cost information for the specified + /// SKU. + /// Restrictions which would prevent a SKU + /// from being used. This is empty if there are no + /// restrictions. + public CatalogSku(string resourceType = default(string), string name = default(string), string tier = default(string), IList locations = default(IList), SkuCapacity capacity = default(SkuCapacity), IList capabilities = default(IList), IList costs = default(IList), IList restrictions = default(IList)) + { + ResourceType = resourceType; + Name = name; + Tier = tier; + Locations = locations; + Capacity = capacity; + Capabilities = capabilities; + Costs = costs; + Restrictions = restrictions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource type name + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; private set; } + + /// + /// Gets SKU name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets SKU tier + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; private set; } + + /// + /// Gets regions where the SKU is available. + /// + [JsonProperty(PropertyName = "locations")] + public IList Locations { get; private set; } + + /// + /// Gets SKU scaling information + /// + [JsonProperty(PropertyName = "capacity")] + public SkuCapacity Capacity { get; private set; } + + /// + /// Gets the capability information for the specified SKU. + /// + [JsonProperty(PropertyName = "capabilities")] + public IList Capabilities { get; private set; } + + /// + /// Gets the cost information for the specified SKU. + /// + [JsonProperty(PropertyName = "costs")] + public IList Costs { get; private set; } + + /// + /// Gets restrictions which would prevent a SKU from being used. This + /// is empty if there are no restrictions. + /// + [JsonProperty(PropertyName = "restrictions")] + public IList Restrictions { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociation.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociation.cs index 2a3c767d54bc8..a792c135e4048 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociation.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociation.cs @@ -1,13 +1,18 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class CommitmentAssociation : Resource /// /// Initializes a new instance of the CommitmentAssociation class. /// - public CommitmentAssociation() { } + public CommitmentAssociation() + { + CustomInit(); + } /// /// Initializes a new instance of the CommitmentAssociation class. @@ -33,29 +41,35 @@ public CommitmentAssociation() { } /// concurrency. /// The properties of the commitment /// association resource. - public CommitmentAssociation(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), CommitmentAssociationProperties properties = default(CommitmentAssociationProperties)) + public CommitmentAssociation(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string), CommitmentAssociationProperties properties = default(CommitmentAssociationProperties)) : base(location, id, name, type, tags) { Etag = etag; Properties = properties; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an entity tag used to enforce optimistic concurrency. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Gets or sets the properties of the commitment association resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + [JsonProperty(PropertyName = "properties")] public CommitmentAssociationProperties Properties { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociationProperties.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociationProperties.cs index 4dbf6adf55016..8bb23bcc5ebe7 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociationProperties.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentAssociationProperties.cs @@ -1,13 +1,16 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +22,10 @@ public partial class CommitmentAssociationProperties /// Initializes a new instance of the CommitmentAssociationProperties /// class. /// - public CommitmentAssociationProperties() { } + public CommitmentAssociationProperties() + { + CustomInit(); + } /// /// Initializes a new instance of the CommitmentAssociationProperties @@ -37,26 +43,32 @@ public CommitmentAssociationProperties() { } AssociatedResourceId = associatedResourceId; CommitmentPlanId = commitmentPlanId; CreationDate = creationDate; + CustomInit(); } /// - /// Gets the ID of the resource this association points to, such as - /// the ARM ID of an Azure ML web service. + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the ID of the resource this association points to, such as the + /// ARM ID of an Azure ML web service. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "associatedResourceId")] + [JsonProperty(PropertyName = "associatedResourceId")] public string AssociatedResourceId { get; private set; } /// /// Gets the ARM ID of the parent Azure ML commitment plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "commitmentPlanId")] + [JsonProperty(PropertyName = "commitmentPlanId")] public string CommitmentPlanId { get; private set; } /// /// Gets the date at which this commitment association was created, in /// ISO 8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "creationDate")] + [JsonProperty(PropertyName = "creationDate")] public System.DateTime? CreationDate { get; private set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlan.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlan.cs index fd4f4c618ae4f..83b3bb34c5a18 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlan.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlan.cs @@ -1,13 +1,18 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class CommitmentPlan : Resource /// /// Initializes a new instance of the CommitmentPlan class. /// - public CommitmentPlan() { } + public CommitmentPlan() + { + CustomInit(); + } /// /// Initializes a new instance of the CommitmentPlan class. @@ -32,36 +40,42 @@ public CommitmentPlan() { } /// concurrency. /// The commitment plan properties. /// The commitment plan SKU. - public CommitmentPlan(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), CommitmentPlanProperties properties = default(CommitmentPlanProperties), ResourceSku sku = default(ResourceSku)) + public CommitmentPlan(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string), CommitmentPlanProperties properties = default(CommitmentPlanProperties), ResourceSku sku = default(ResourceSku)) : base(location, id, name, type, tags) { Etag = etag; Properties = properties; Sku = sku; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets an entity tag used to enforce optimistic concurrency. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// /// Gets the commitment plan properties. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + [JsonProperty(PropertyName = "properties")] public CommitmentPlanProperties Properties { get; private set; } /// /// Gets or sets the commitment plan SKU. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + [JsonProperty(PropertyName = "sku")] public ResourceSku Sku { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanPatchPayload.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanPatchPayload.cs index aa229333b1271..6f28a8357c840 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanPatchPayload.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanPatchPayload.cs @@ -1,13 +1,18 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class CommitmentPlanPatchPayload /// /// Initializes a new instance of the CommitmentPlanPatchPayload class. /// - public CommitmentPlanPatchPayload() { } + public CommitmentPlanPatchPayload() + { + CustomInit(); + } /// /// Initializes a new instance of the CommitmentPlanPatchPayload class. @@ -26,22 +34,28 @@ public CommitmentPlanPatchPayload() { } /// User-defined tags for the commitment /// plan. /// The commitment plan SKU. - public CommitmentPlanPatchPayload(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ResourceSku sku = default(ResourceSku)) + public CommitmentPlanPatchPayload(IDictionary tags = default(IDictionary), ResourceSku sku = default(ResourceSku)) { Tags = tags; Sku = sku; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets user-defined tags for the commitment plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] - public System.Collections.Generic.IDictionary Tags { get; set; } + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } /// /// Gets or sets the commitment plan SKU. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + [JsonProperty(PropertyName = "sku")] public ResourceSku Sku { get; set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanProperties.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanProperties.cs index d4c173ec1a39c..ae9ce844ab4e7 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanProperties.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/CommitmentPlanProperties.cs @@ -1,13 +1,18 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -18,7 +23,10 @@ public partial class CommitmentPlanProperties /// /// Initializes a new instance of the CommitmentPlanProperties class. /// - public CommitmentPlanProperties() { } + public CommitmentPlanProperties() + { + CustomInit(); + } /// /// Initializes a new instance of the CommitmentPlanProperties class. @@ -42,10 +50,9 @@ public CommitmentPlanProperties() { } /// The frequency at which this /// commitment plan's included quantities are refilled. /// Indicates whether this - /// commitment plan will be moved into a suspended state if usage - /// beyond the commitment plan's included quantities is - /// incurred. - public CommitmentPlanProperties(bool? chargeForOverage = default(bool?), bool? chargeForPlan = default(bool?), System.DateTime? creationDate = default(System.DateTime?), System.Collections.Generic.IDictionary includedQuantities = default(System.Collections.Generic.IDictionary), int? maxAssociationLimit = default(int?), int? maxCapacityLimit = default(int?), int? minCapacityLimit = default(int?), string planMeter = default(string), int? refillFrequencyInDays = default(int?), bool? suspendPlanOnOverage = default(bool?)) + /// commitment plan will be moved into a suspended state if usage goes + /// beyond the commitment plan's included quantities. + public CommitmentPlanProperties(bool? chargeForOverage = default(bool?), bool? chargeForPlan = default(bool?), System.DateTime? creationDate = default(System.DateTime?), IDictionary includedQuantities = default(IDictionary), int? maxAssociationLimit = default(int?), int? maxCapacityLimit = default(int?), int? minCapacityLimit = default(int?), string planMeter = default(string), int? refillFrequencyInDays = default(int?), bool? suspendPlanOnOverage = default(bool?)) { ChargeForOverage = chargeForOverage; ChargeForPlan = chargeForPlan; @@ -57,73 +64,79 @@ public CommitmentPlanProperties() { } PlanMeter = planMeter; RefillFrequencyInDays = refillFrequencyInDays; SuspendPlanOnOverage = suspendPlanOnOverage; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets indicates whether usage beyond the commitment plan's included /// quantities will be charged. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "chargeForOverage")] + [JsonProperty(PropertyName = "chargeForOverage")] public bool? ChargeForOverage { get; private set; } /// /// Gets indicates whether the commitment plan will incur a charge. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "chargeForPlan")] + [JsonProperty(PropertyName = "chargeForPlan")] public bool? ChargeForPlan { get; private set; } /// /// Gets the date at which this commitment plan was created, in ISO /// 8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "creationDate")] + [JsonProperty(PropertyName = "creationDate")] public System.DateTime? CreationDate { get; private set; } /// /// Gets the included resource quantities this plan gives you. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "includedQuantities")] - public System.Collections.Generic.IDictionary IncludedQuantities { get; private set; } + [JsonProperty(PropertyName = "includedQuantities")] + public IDictionary IncludedQuantities { get; private set; } /// /// Gets the maximum number of commitment associations that can be /// children of this commitment plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxAssociationLimit")] + [JsonProperty(PropertyName = "maxAssociationLimit")] public int? MaxAssociationLimit { get; private set; } /// /// Gets the maximum scale-out capacity for this commitment plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maxCapacityLimit")] + [JsonProperty(PropertyName = "maxCapacityLimit")] public int? MaxCapacityLimit { get; private set; } /// /// Gets the minimum scale-out capacity for this commitment plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "minCapacityLimit")] + [JsonProperty(PropertyName = "minCapacityLimit")] public int? MinCapacityLimit { get; private set; } /// /// Gets the Azure meter which will be used to charge for this /// commitment plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "planMeter")] + [JsonProperty(PropertyName = "planMeter")] public string PlanMeter { get; private set; } /// /// Gets the frequency at which this commitment plan's included /// quantities are refilled. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "refillFrequencyInDays")] + [JsonProperty(PropertyName = "refillFrequencyInDays")] public int? RefillFrequencyInDays { get; private set; } /// /// Gets indicates whether this commitment plan will be moved into a - /// suspended state if usage beyond the commitment plan's included - /// quantities is incurred. + /// suspended state if usage goes beyond the commitment plan's included + /// quantities. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "suspendPlanOnOverage")] + [JsonProperty(PropertyName = "suspendPlanOnOverage")] public bool? SuspendPlanOnOverage { get; private set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/MoveCommitmentAssociationRequest.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/MoveCommitmentAssociationRequest.cs index dacdbb3b3931c..5579e6c7c0ce6 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/MoveCommitmentAssociationRequest.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/MoveCommitmentAssociationRequest.cs @@ -1,13 +1,16 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; using System.Linq; /// @@ -20,7 +23,10 @@ public partial class MoveCommitmentAssociationRequest /// Initializes a new instance of the MoveCommitmentAssociationRequest /// class. /// - public MoveCommitmentAssociationRequest() { } + public MoveCommitmentAssociationRequest() + { + CustomInit(); + } /// /// Initializes a new instance of the MoveCommitmentAssociationRequest @@ -31,13 +37,19 @@ public MoveCommitmentAssociationRequest() { } public MoveCommitmentAssociationRequest(string destinationPlanId = default(string)) { DestinationPlanId = destinationPlanId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the ARM ID of the commitment plan to re-parent the /// commitment association to. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPlanId")] + [JsonProperty(PropertyName = "destinationPlanId")] public string DestinationPlanId { get; set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationDisplayInfo.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationDisplayInfo.cs new file mode 100644 index 0000000000000..f5b7791b0df68 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationDisplayInfo.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The API operation info. + /// + public partial class OperationDisplayInfo + { + /// + /// Initializes a new instance of the OperationDisplayInfo class. + /// + public OperationDisplayInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplayInfo class. + /// + /// The description of the operation. + /// The action that users can perform, based on + /// their permission level. + /// The service provider. + /// The resource on which the operation is + /// performed. + public OperationDisplayInfo(string description = default(string), string operation = default(string), string provider = default(string), string resource = default(string)) + { + Description = description; + Operation = operation; + Provider = provider; + Resource = resource; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the description of the operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + /// + /// Gets the action that users can perform, based on their permission + /// level. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; private set; } + + /// + /// Gets the service provider. + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; private set; } + + /// + /// Gets the resource on which the operation is performed. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationEntity.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationEntity.cs new file mode 100644 index 0000000000000..4431ebd97b822 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/OperationEntity.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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An API operation. + /// + public partial class OperationEntity + { + /// + /// Initializes a new instance of the OperationEntity class. + /// + public OperationEntity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationEntity class. + /// + /// Operation name: + /// {provider}/{resource}/{operation}. + /// The API operation info. + public OperationEntity(string name = default(string), OperationDisplayInfo display = default(OperationDisplayInfo)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets operation name: {provider}/{resource}/{operation}. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets the API operation info. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplayInfo Display { get; set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page.cs index b0c92b5772ea6..d8191257580d3 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page.cs @@ -1,44 +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 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans.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 - [Newtonsoft.Json.JsonObject] - public class Page : Microsoft.Rest.Azure.IPage + [JsonObject] + public class Page : IPage { /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("nextLink")] - public System.String NextPageLink { get; private set; } + [JsonProperty("")] + public string NextPageLink { get; private set; } - [Newtonsoft.Json.JsonProperty("value")] - private System.Collections.Generic.IList Items{ get; 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 System.Collections.Generic.IEnumerator GetEnumerator() + public IEnumerator GetEnumerator() { - return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page1.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Page1.cs new file mode 100644 index 0000000000000..bfe6b9c800a24 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/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.MachineLearning.CommitmentPlans.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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanQuantity.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanQuantity.cs index c838a4c9dc805..698f61193f3e9 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanQuantity.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanQuantity.cs @@ -1,13 +1,16 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +22,10 @@ public partial class PlanQuantity /// /// Initializes a new instance of the PlanQuantity class. /// - public PlanQuantity() { } + public PlanQuantity() + { + CustomInit(); + } /// /// Initializes a new instance of the PlanQuantity class. @@ -38,32 +44,38 @@ public PlanQuantity() { } Amount = amount; IncludedQuantityMeter = includedQuantityMeter; OverageMeter = overageMeter; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the quantity added to the commitment plan at an interval /// specified by its allowance frequency. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "allowance")] + [JsonProperty(PropertyName = "allowance")] public double? Allowance { get; private set; } /// /// Gets the quantity available to the plan the last time usage was /// calculated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "amount")] + [JsonProperty(PropertyName = "amount")] public double? Amount { get; private set; } /// /// Gets the Azure meter for usage against included quantities. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "includedQuantityMeter")] + [JsonProperty(PropertyName = "includedQuantityMeter")] public string IncludedQuantityMeter { get; private set; } /// /// Gets the Azure meter for usage which exceeds included quantities. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "overageMeter")] + [JsonProperty(PropertyName = "overageMeter")] public string OverageMeter { get; private set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanUsageHistory.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanUsageHistory.cs index deaeab8f757f1..a6ed7a67e5623 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanUsageHistory.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/PlanUsageHistory.cs @@ -1,13 +1,18 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -19,7 +24,10 @@ public partial class PlanUsageHistory /// /// Initializes a new instance of the PlanUsageHistory class. /// - public PlanUsageHistory() { } + public PlanUsageHistory() + { + CustomInit(); + } /// /// Initializes a new instance of the PlanUsageHistory class. @@ -41,7 +49,7 @@ public PlanUsageHistory() { } /// resources. /// The date of usage, in ISO 8601 /// format. - public PlanUsageHistory(System.Collections.Generic.IDictionary planDeletionOverage = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IDictionary planMigrationOverage = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IDictionary planQuantitiesAfterUsage = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IDictionary planQuantitiesBeforeUsage = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IDictionary planUsageOverage = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IDictionary usage = default(System.Collections.Generic.IDictionary), System.DateTime? usageDate = default(System.DateTime?)) + public PlanUsageHistory(IDictionary planDeletionOverage = default(IDictionary), IDictionary planMigrationOverage = default(IDictionary), IDictionary planQuantitiesAfterUsage = default(IDictionary), IDictionary planQuantitiesBeforeUsage = default(IDictionary), IDictionary planUsageOverage = default(IDictionary), IDictionary usage = default(IDictionary), System.DateTime? usageDate = default(System.DateTime?)) { PlanDeletionOverage = planDeletionOverage; PlanMigrationOverage = planMigrationOverage; @@ -50,55 +58,61 @@ public PlanUsageHistory() { } PlanUsageOverage = planUsageOverage; Usage = usage; UsageDate = usageDate; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets overage incurred as a result of deleting a commitment /// plan. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "planDeletionOverage")] - public System.Collections.Generic.IDictionary PlanDeletionOverage { get; set; } + [JsonProperty(PropertyName = "planDeletionOverage")] + public IDictionary PlanDeletionOverage { get; set; } /// - /// Gets or sets overage incurred as a result of migrating a - /// commitment plan from one SKU to another. + /// Gets or sets overage incurred as a result of migrating a commitment + /// plan from one SKU to another. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "planMigrationOverage")] - public System.Collections.Generic.IDictionary PlanMigrationOverage { get; set; } + [JsonProperty(PropertyName = "planMigrationOverage")] + public IDictionary PlanMigrationOverage { get; set; } /// /// Gets or sets included quantities remaining after usage against the /// commitment plan's associated resources was calculated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "planQuantitiesAfterUsage")] - public System.Collections.Generic.IDictionary PlanQuantitiesAfterUsage { get; set; } + [JsonProperty(PropertyName = "planQuantitiesAfterUsage")] + public IDictionary PlanQuantitiesAfterUsage { get; set; } /// - /// Gets or sets included quantities remaining before usage against - /// the commitment plan's associated resources was calculated. + /// Gets or sets included quantities remaining before usage against the + /// commitment plan's associated resources was calculated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "planQuantitiesBeforeUsage")] - public System.Collections.Generic.IDictionary PlanQuantitiesBeforeUsage { get; set; } + [JsonProperty(PropertyName = "planQuantitiesBeforeUsage")] + public IDictionary PlanQuantitiesBeforeUsage { get; set; } /// /// Gets or sets usage against the commitment plan's associated /// resources which was not covered by included quantities and is /// therefore overage. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "planUsageOverage")] - public System.Collections.Generic.IDictionary PlanUsageOverage { get; set; } + [JsonProperty(PropertyName = "planUsageOverage")] + public IDictionary PlanUsageOverage { get; set; } /// /// Gets or sets usage against the commitment plan's associated /// resources. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "usage")] - public System.Collections.Generic.IDictionary Usage { get; set; } + [JsonProperty(PropertyName = "usage")] + public IDictionary Usage { get; set; } /// /// Gets or sets the date of usage, in ISO 8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "usageDate")] + [JsonProperty(PropertyName = "usageDate")] public System.DateTime? UsageDate { get; set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Resource.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Resource.cs index 67c1add69648b..2b6e5d479126d 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Resource.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/Resource.cs @@ -1,24 +1,34 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans.Models { + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Common properties of an ARM resource. /// - public partial class Resource : Microsoft.Rest.Azure.IResource + public partial class Resource : IResource { /// /// Initializes a new instance of the Resource class. /// - public Resource() { } + public Resource() + { + CustomInit(); + } /// /// Initializes a new instance of the Resource class. @@ -28,56 +38,62 @@ public Resource() { } /// Resource name. /// Resource type. /// User-defined tags for the resource. - public Resource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) { Id = id; Name = name; Location = location; Type = type; Tags = tags; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets resource Id. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// /// Gets resource name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// /// Gets or sets resource location. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// /// Gets resource type. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + [JsonProperty(PropertyName = "type")] public string Type { get; private set; } /// /// Gets or sets user-defined tags for the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] - public System.Collections.Generic.IDictionary Tags { get; set; } + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Location == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); } } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSku.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSku.cs index 8db25c7df3aef..584b04ada1172 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSku.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSku.cs @@ -1,13 +1,16 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans.Models { + using Newtonsoft.Json; using System.Linq; /// @@ -18,13 +21,16 @@ public partial class ResourceSku /// /// Initializes a new instance of the ResourceSku class. /// - public ResourceSku() { } + public ResourceSku() + { + CustomInit(); + } /// /// Initializes a new instance of the ResourceSku class. /// - /// The scale-out capacity of the resource. 1 - /// is 1x, 2 is 2x, etc. This impacts the quantities and cost of any + /// The scale-out capacity of the resource. 1 is + /// 1x, 2 is 2x, etc. This impacts the quantities and cost of any /// commitment plan resource. /// The SKU name. Along with tier, uniquely /// identifies the SKU. @@ -35,28 +41,34 @@ public ResourceSku() { } Capacity = capacity; Name = name; Tier = tier; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the scale-out capacity of the resource. 1 is 1x, 2 is /// 2x, etc. This impacts the quantities and cost of any commitment /// plan resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + [JsonProperty(PropertyName = "capacity")] public int? Capacity { get; set; } /// - /// Gets or sets the SKU name. Along with tier, uniquely identifies - /// the SKU. + /// Gets or sets the SKU name. Along with tier, uniquely identifies the + /// SKU. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets or sets the SKU tier. Along with name, uniquely identifies - /// the SKU. + /// Gets or sets the SKU tier. Along with name, uniquely identifies the + /// SKU. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + [JsonProperty(PropertyName = "tier")] public string Tier { get; set; } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsReasonCode.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsReasonCode.cs new file mode 100644 index 0000000000000..7c1ab21b400fd --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsReasonCode.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.MachineLearning.CommitmentPlans.Models +{ + + /// + /// Defines values for ResourceSkuRestrictionsReasonCode. + /// + public static class ResourceSkuRestrictionsReasonCode + { + public const string QuotaId = "QuotaId"; + public const string NotAvailableForSubscription = "NotAvailableForSubscription"; + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsType.cs new file mode 100644 index 0000000000000..ac37b1127674f --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/ResourceSkuRestrictionsType.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.MachineLearning.CommitmentPlans.Models +{ + + /// + /// Defines values for ResourceSkuRestrictionsType. + /// + public static class ResourceSkuRestrictionsType + { + public const string Location = "location"; + public const string Zone = "zone"; + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapability.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapability.cs new file mode 100644 index 0000000000000..4948e52b192e2 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes The SKU capabilities object. + /// + public partial class SkuCapability + { + /// + /// Initializes a new instance of the SkuCapability class. + /// + public SkuCapability() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuCapability class. + /// + /// The capability name. + /// The capability value. + 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 the capability name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the capability value. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacity.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacity.cs new file mode 100644 index 0000000000000..26450a837d03d --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacity.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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes scaling information of a SKU. + /// + public partial class SkuCapacity + { + /// + /// Initializes a new instance of the SkuCapacity class. + /// + public SkuCapacity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuCapacity class. + /// + /// The minimum capacity. + /// The maximum capacity that can be set. + /// The default capacity. + /// The scale type applicable to the sku. + /// Possible values include: 'Automatic', 'Manual', 'None' + public SkuCapacity(long? minimum = default(long?), long? maximum = default(long?), long? defaultProperty = default(long?), string scaleType = default(string)) + { + Minimum = minimum; + Maximum = maximum; + DefaultProperty = defaultProperty; + ScaleType = scaleType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the minimum capacity. + /// + [JsonProperty(PropertyName = "minimum")] + public long? Minimum { get; private set; } + + /// + /// Gets the maximum capacity that can be set. + /// + [JsonProperty(PropertyName = "maximum")] + public long? Maximum { get; private set; } + + /// + /// Gets the default capacity. + /// + [JsonProperty(PropertyName = "default")] + public long? DefaultProperty { get; private set; } + + /// + /// Gets the scale type applicable to the sku. Possible values include: + /// 'Automatic', 'Manual', 'None' + /// + [JsonProperty(PropertyName = "scaleType")] + public string ScaleType { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacityScaleType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacityScaleType.cs new file mode 100644 index 0000000000000..d668e06eb08bc --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCapacityScaleType.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.MachineLearning.CommitmentPlans.Models +{ + + /// + /// Defines values for SkuCapacityScaleType. + /// + public static class SkuCapacityScaleType + { + public const string Automatic = "Automatic"; + public const string Manual = "Manual"; + public const string None = "None"; + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCost.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCost.cs new file mode 100644 index 0000000000000..7b28e0b052ce2 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuCost.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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes metadata for SKU cost info. + /// + public partial class SkuCost + { + /// + /// Initializes a new instance of the SkuCost class. + /// + public SkuCost() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuCost class. + /// + /// The meter used for this part of a SKU's + /// cost. + /// The multiplier for the meter ID. + /// The overall duration represented by the + /// quantity. + public SkuCost(string meterID = default(string), long? quantity = default(long?), string extendedUnit = default(string)) + { + MeterID = meterID; + Quantity = quantity; + ExtendedUnit = extendedUnit; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the meter used for this part of a SKU's cost. + /// + [JsonProperty(PropertyName = "meterID")] + public string MeterID { get; private set; } + + /// + /// Gets the multiplier for the meter ID. + /// + [JsonProperty(PropertyName = "quantity")] + public long? Quantity { get; private set; } + + /// + /// Gets the overall duration represented by the quantity. + /// + [JsonProperty(PropertyName = "extendedUnit")] + public string ExtendedUnit { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuRestrictions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuRestrictions.cs new file mode 100644 index 0000000000000..0f040d4a5d0f3 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Models/SkuRestrictions.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.MachineLearning.CommitmentPlans.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes restrictions which would prevent a SKU from being used. + /// + public partial class SkuRestrictions + { + /// + /// Initializes a new instance of the SkuRestrictions class. + /// + public SkuRestrictions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuRestrictions class. + /// + /// The type of restrictions. Possible values + /// include: 'location', 'zone' + /// 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 restriction. Possible + /// values include: 'QuotaId', 'NotAvailableForSubscription' + public SkuRestrictions(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. Possible values include: 'location', + /// 'zone' + /// + [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 the reason for restriction. Possible values include: + /// 'QuotaId', 'NotAvailableForSubscription' + /// + [JsonProperty(PropertyName = "reasonCode")] + public string ReasonCode { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Operations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Operations.cs new file mode 100644 index 0000000000000..82f2821876ab2 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/Operations.cs @@ -0,0 +1,228 @@ +// +// 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.MachineLearning.CommitmentPlans +{ + 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(AzureMLCommitmentPlansManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMLCommitmentPlansManagementClient + /// + public AzureMLCommitmentPlansManagementClient Client { get; private set; } + + /// + /// Lists all of the available Azure Machine Learning Studio Commitment Plan RP + /// 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.MachineLearning/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/OperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/OperationsExtensions.cs new file mode 100644 index 0000000000000..fcbce82c783f2 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/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.MachineLearning.CommitmentPlans +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available Azure Machine Learning Studio Commitment Plan RP + /// 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 Studio Commitment Plan RP + /// 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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SdkInfo_AzureMLCommitmentPlansManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SdkInfo_AzureMLCommitmentPlansManagementClient.cs new file mode 100644 index 0000000000000..a62dd37437eb8 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SdkInfo_AzureMLCommitmentPlansManagementClient.cs @@ -0,0 +1,31 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_AzureMLCommitmentPlansManagementClient + { + get + { + return new Tuple[] + { + new Tuple("MachineLearning", "CommitmentAssociations", "2016-05-01-preview"), + new Tuple("MachineLearning", "CommitmentPlans", "2016-05-01-preview"), + new Tuple("MachineLearning", "Operations", "2016-05-01-preview"), + new Tuple("MachineLearning", "Skus", "2016-05-01-preview"), + new Tuple("MachineLearning", "UsageHistory", "2016-05-01-preview"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperations.cs new file mode 100644 index 0000000000000..998f6fa13842d --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperations.cs @@ -0,0 +1,232 @@ +// +// 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.MachineLearning.CommitmentPlans +{ + 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; + + /// + /// SkusOperations operations. + /// + internal partial class SkusOperations : IServiceOperations, ISkusOperations + { + /// + /// Initializes a new instance of the SkusOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SkusOperations(AzureMLCommitmentPlansManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMLCommitmentPlansManagementClient + /// + public AzureMLCommitmentPlansManagementClient Client { get; private set; } + + /// + /// Lists the available commitment plan SKUs. + /// + /// + /// 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.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/skus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperationsExtensions.cs new file mode 100644 index 0000000000000..496c081e8d1ed --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/SkusOperationsExtensions.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.MachineLearning.CommitmentPlans +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SkusOperations. + /// + public static partial class SkusOperationsExtensions + { + /// + /// Lists the available commitment plan SKUs. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable List(this ISkusOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists the available commitment plan SKUs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ISkusOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperations.cs index 968a7145dad8d..b9e85c5316853 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperations.cs @@ -1,22 +1,31 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans { - using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// UsageHistoryOperations operations. /// - internal partial class UsageHistoryOperations : Microsoft.Rest.IServiceOperations, IUsageHistoryOperations + internal partial class UsageHistoryOperations : IServiceOperations, IUsageHistoryOperations { /// /// Initializes a new instance of the UsageHistoryOperations class. @@ -29,11 +38,11 @@ internal partial class UsageHistoryOperations : Microsoft.Rest.IServiceOperation /// internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -42,7 +51,7 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) public AzureMLCommitmentPlansManagementClient Client { get; private set; } /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The resource group name. @@ -59,86 +68,91 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string commitmentPlanName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (commitmentPlanName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commitmentPlanName"); + throw new ValidationException(ValidationRules.CannotBeNull, "commitmentPlanName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("commitmentPlanName", commitmentPlanName); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/usageHistory").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{commitmentPlanName}", System.Uri.EscapeDataString(commitmentPlanName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,51 +168,51 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -208,7 +222,7 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -221,27 +235,27 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The NextLink from the previous successful call to List operation. @@ -252,61 +266,66 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -322,51 +341,51 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -376,7 +395,7 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -389,21 +408,21 @@ internal UsageHistoryOperations(AzureMLCommitmentPlansManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperationsExtensions.cs index fd6654385ed73..d4cc21bace181 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperationsExtensions.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/CommitmentPlans/UsageHistoryOperationsExtensions.cs @@ -1,16 +1,20 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans { + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for UsageHistoryOperations. @@ -18,7 +22,7 @@ namespace Microsoft.Azure.Management.MachineLearning.CommitmentPlans public static partial class UsageHistoryOperationsExtensions { /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The operations group for this extension method. @@ -32,13 +36,13 @@ public static partial class UsageHistoryOperationsExtensions /// /// Continuation token for pagination. /// - public static Microsoft.Rest.Azure.IPage List(this IUsageHistoryOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string)) + public static IPage List(this IUsageHistoryOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsageHistoryOperations)s).ListAsync(resourceGroupName, commitmentPlanName, skipToken), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, commitmentPlanName, skipToken).GetAwaiter().GetResult(); } /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The operations group for this extension method. @@ -55,7 +59,7 @@ public static partial class UsageHistoryOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListAsync(this IUsageHistoryOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IUsageHistoryOperations operations, string resourceGroupName, string commitmentPlanName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, skipToken, null, cancellationToken).ConfigureAwait(false)) { @@ -64,7 +68,7 @@ public static partial class UsageHistoryOperationsExtensions } /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The operations group for this extension method. @@ -72,13 +76,13 @@ public static partial class UsageHistoryOperationsExtensions /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IUsageHistoryOperations operations, string nextPageLink) + public static IPage ListNext(this IUsageHistoryOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsageHistoryOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Retrieves the usage history for an Azure ML commitment plan. + /// Retrieve the usage history for an Azure ML commitment plan. /// /// /// The operations group for this extension method. @@ -89,7 +93,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IUsageH /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IUsageHistoryOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IUsageHistoryOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/AzureMLWebServicesManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/AzureMLWebServicesManagementClient.cs index 97f5b86e4e180..8a04aa606cb97 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/AzureMLWebServicesManagementClient.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/AzureMLWebServicesManagementClient.cs @@ -1,12 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; using Microsoft.Rest; using Microsoft.Rest.Azure; using Microsoft.Rest.Serialization; @@ -62,27 +65,46 @@ public partial class AzureMLWebServicesManagementClient : ServiceClient - /// Gets or sets the preferred language for the response. + /// The preferred language for the response. /// public string AcceptLanguage { get; set; } /// - /// Gets or sets the retry timeout in seconds for Long Running Operations. - /// Default value is 30. + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. /// public int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. /// public bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + /// /// Gets the IWebServicesOperations. /// public virtual IWebServicesOperations WebServices { get; private set; } + /// + /// Initializes a new instance of the AzureMLWebServicesManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureMLWebServicesManagementClient.Dispose(). False: will not dispose provided httpClient + protected AzureMLWebServicesManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + /// /// Initializes a new instance of the AzureMLWebServicesManagementClient class. /// @@ -178,6 +200,33 @@ public AzureMLWebServicesManagementClient(ServiceClientCredentials credentials, } } + /// + /// Initializes a new instance of the AzureMLWebServicesManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureMLWebServicesManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public AzureMLWebServicesManagementClient(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 AzureMLWebServicesManagementClient class. /// @@ -284,6 +333,7 @@ public AzureMLWebServicesManagementClient(System.Uri baseUri, ServiceClientCrede /// private void Initialize() { + Operations = new Operations(this); WebServices = new WebServicesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2017-01-01"; diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IAzureMLWebServicesManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IAzureMLWebServicesManagementClient.cs index 86bed6fbb621b..f5e1e22144639 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IAzureMLWebServicesManagementClient.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IAzureMLWebServicesManagementClient.cs @@ -1,12 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -57,23 +60,29 @@ public partial interface IAzureMLWebServicesManagementClient : System.IDisposabl string ApiVersion { get; } /// - /// Gets or sets the preferred language for the response. + /// The preferred language for the response. /// string AcceptLanguage { get; set; } /// - /// Gets or sets the retry timeout in seconds for Long Running - /// Operations. Default value is 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. /// int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is generated - /// and included in each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. /// bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + /// /// Gets the IWebServicesOperations. /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IOperations.cs new file mode 100644 index 0000000000000..fd9f36c77a8bf --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IOperations.cs @@ -0,0 +1,46 @@ +// +// 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.MachineLearning.WebServices +{ + 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 the available 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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IWebServicesOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IWebServicesOperations.cs index f7c80dd830104..9d056b8fe3c60 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IWebServicesOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/IWebServicesOperations.cs @@ -1,12 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -112,7 +115,7 @@ public partial interface IWebServicesOperations /// /// Thrown when a required parameter is null /// - Task> PatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, WebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> PatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, PatchedWebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes the specified web service. /// @@ -302,7 +305,7 @@ public partial interface IWebServicesOperations /// /// Thrown when a required parameter is null /// - Task> BeginPatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, WebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginPatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, PatchedWebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes the specified web service. /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetItem.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetItem.cs index 57150943b626f..690dc8e00b4c5 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetItem.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetItem.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; @@ -24,7 +26,7 @@ public partial class AssetItem /// public AssetItem() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetType.cs index 22b3736a93257..a134414a78957 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetType.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AssetType.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for AssetType. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationErrorInfo.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationErrorInfo.cs index af099828f1230..d3ac17b541518 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationErrorInfo.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationErrorInfo.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +25,7 @@ public partial class AsyncOperationErrorInfo /// public AsyncOperationErrorInfo() { - CustomInit(); + CustomInit(); } /// @@ -49,28 +51,28 @@ public AsyncOperationErrorInfo() partial void CustomInit(); /// - /// Gets or sets the error code. + /// Gets the error code. /// [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + public string Code { get; private set; } /// - /// Gets or sets the error target. + /// Gets the error target. /// [JsonProperty(PropertyName = "target")] - public string Target { get; set; } + public string Target { get; private set; } /// - /// Gets or sets the error message. + /// Gets the error message. /// [JsonProperty(PropertyName = "message")] - public string Message { get; set; } + public string Message { get; private set; } /// - /// Gets or sets an array containing error information. + /// Gets an array containing error information. /// [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } + public IList Details { get; private set; } } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationStatus.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationStatus.cs index 4a268f8473995..2c940e32cd835 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationStatus.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/AsyncOperationStatus.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class AsyncOperationStatus /// public AsyncOperationStatus() { - CustomInit(); + CustomInit(); } /// @@ -58,16 +60,16 @@ public AsyncOperationStatus() partial void CustomInit(); /// - /// Gets or sets async operation id. + /// Gets async operation id. /// [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + public string Id { get; private set; } /// - /// Gets or sets async operation name. + /// Gets async operation name. /// [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + public string Name { get; private set; } /// /// Gets read Only: The provisioning state of the web service. Valid @@ -90,17 +92,17 @@ public AsyncOperationStatus() public System.DateTime? EndTime { get; private set; } /// - /// Gets or sets async operation progress. + /// Gets async operation progress. /// [JsonProperty(PropertyName = "percentComplete")] - public double? PercentComplete { get; set; } + public double? PercentComplete { get; private set; } /// - /// Gets or sets if the async operation fails, this structure contains - /// the error details. + /// Gets if the async operation fails, this structure contains the + /// error details. /// [JsonProperty(PropertyName = "errorInfo")] - public AsyncOperationErrorInfo ErrorInfo { get; set; } + public AsyncOperationErrorInfo ErrorInfo { get; private set; } } } diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/BlobLocation.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/BlobLocation.cs index 0db14597bb0c9..627b2b55fecf7 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/BlobLocation.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/BlobLocation.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -22,7 +24,7 @@ public partial class BlobLocation /// public BlobLocation() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnFormat.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnFormat.cs index 1b0375302ad54..a8057c21d7717 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnFormat.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnFormat.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for ColumnFormat. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnSpecification.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnSpecification.cs index ce020e2c147ee..2e0dcd19f09d8 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnSpecification.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnSpecification.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; @@ -26,7 +28,7 @@ public partial class ColumnSpecification /// public ColumnSpecification() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnType.cs index f8d47e9e0a5d0..dbe2f90335c9a 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnType.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ColumnType.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for ColumnType. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/CommitmentPlan.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/CommitmentPlan.cs index ce496069f342f..94b87a45226f0 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/CommitmentPlan.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/CommitmentPlan.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +25,7 @@ public partial class CommitmentPlan /// public CommitmentPlan() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsConfiguration.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsConfiguration.cs index 1da135a7b2cf0..9a300e5aee71a 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsConfiguration.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsConfiguration.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -22,7 +24,7 @@ public partial class DiagnosticsConfiguration /// public DiagnosticsConfiguration() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsLevel.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsLevel.cs index f22377f4647d5..4bf6bd2290148 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsLevel.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/DiagnosticsLevel.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for DiagnosticsLevel. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ExampleRequest.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ExampleRequest.cs index 908cd5b3bb0c4..493a651a8a9c5 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ExampleRequest.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ExampleRequest.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +25,7 @@ public partial class ExampleRequest /// public ExampleRequest() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphEdge.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphEdge.cs index f040a7d8d11d8..5ef2ba6ff68fd 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphEdge.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphEdge.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class GraphEdge /// public GraphEdge() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphNode.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphNode.cs index d4ed58fb9152e..4cf4f90a3e7a1 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphNode.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphNode.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +27,7 @@ public partial class GraphNode /// public GraphNode() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphPackage.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphPackage.cs index 71722811f0132..379940c518073 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphPackage.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphPackage.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +25,7 @@ public partial class GraphPackage /// public GraphPackage() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameter.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameter.cs index d6c098841611b..43fe68f0a6092 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameter.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameter.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; @@ -24,7 +26,7 @@ public partial class GraphParameter /// public GraphParameter() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameterLink.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameterLink.cs index 3827df6fc49d8..250c0f05930cb 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameterLink.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/GraphParameterLink.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -22,7 +24,7 @@ public partial class GraphParameterLink /// public GraphParameterLink() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPort.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPort.cs index d5c42f5dea37b..e3e4721e7f776 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPort.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPort.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class InputPort /// public InputPort() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPortType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPortType.cs index cbdbff530fd4b..5335a80af7cd2 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPortType.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/InputPortType.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for InputPortType. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/MachineLearningWorkspace.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/MachineLearningWorkspace.cs index 303e70af525f2..aa5c19c1ba9d4 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/MachineLearningWorkspace.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/MachineLearningWorkspace.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +25,7 @@ public partial class MachineLearningWorkspace /// public MachineLearningWorkspace() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModeValueInfo.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModeValueInfo.cs index 081d3d19de628..b262c205db3a0 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModeValueInfo.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModeValueInfo.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +25,7 @@ public partial class ModeValueInfo /// public ModeValueInfo() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModuleAssetParameter.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModuleAssetParameter.cs index f9a4a3875e63f..6a8e80b53b494 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModuleAssetParameter.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ModuleAssetParameter.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +25,7 @@ public partial class ModuleAssetParameter /// public ModuleAssetParameter() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationDisplayInfo.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationDisplayInfo.cs new file mode 100644 index 0000000000000..bd06c0199bd86 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationDisplayInfo.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearning.WebServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The API operation info. + /// + public partial class OperationDisplayInfo + { + /// + /// Initializes a new instance of the OperationDisplayInfo class. + /// + public OperationDisplayInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplayInfo class. + /// + /// The description of the operation. + /// The action that users can perform, based on + /// their permission level. + /// The service provider. + /// The resource on which the operation is + /// performed. + public OperationDisplayInfo(string description = default(string), string operation = default(string), string provider = default(string), string resource = default(string)) + { + Description = description; + Operation = operation; + Provider = provider; + Resource = resource; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the description of the operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + /// + /// Gets the action that users can perform, based on their permission + /// level. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; private set; } + + /// + /// Gets the service provider. + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; private set; } + + /// + /// Gets the resource on which the operation is performed. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; private set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationEntity.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationEntity.cs new file mode 100644 index 0000000000000..badc8d3c0576f --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OperationEntity.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.MachineLearning.WebServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An API operation. + /// + public partial class OperationEntity + { + /// + /// Initializes a new instance of the OperationEntity class. + /// + public OperationEntity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationEntity class. + /// + /// Operation name: + /// {provider}/{resource}/{operation}. + /// The API operation info. + public OperationEntity(string name = default(string), OperationDisplayInfo display = default(OperationDisplayInfo)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets operation name: {provider}/{resource}/{operation}. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets the API operation info. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplayInfo Display { get; set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPort.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPort.cs index 35beacb2053aa..d8f281b575100 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPort.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPort.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class OutputPort /// public OutputPort() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPortType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPortType.cs index aa06b4c274443..7af9ede58d5d6 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPortType.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/OutputPortType.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for OutputPortType. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page.cs index 59eadd37557fa..41dcf8e69bc0f 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Microsoft.Rest.Azure; using Newtonsoft.Json; @@ -24,7 +26,7 @@ public class Page : IPage /// /// Gets the link to the next page. /// - [JsonProperty("nextLink")] + [JsonProperty("")] public string NextPageLink { get; private set; } [JsonProperty("value")] diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page1.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Page1.cs new file mode 100644 index 0000000000000..e0a99dda6b2a3 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/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.MachineLearning.WebServices.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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ParameterType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ParameterType.cs index 004c0cdb1e580..763898404ad21 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ParameterType.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ParameterType.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for ParameterType. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedResource.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedResource.cs new file mode 100644 index 0000000000000..00567dcd4f137 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedResource.cs @@ -0,0 +1,89 @@ +// +// 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.MachineLearning.WebServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure resource. + /// + public partial class PatchedResource : IResource + { + /// + /// Initializes a new instance of the PatchedResource class. + /// + public PatchedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PatchedResource class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + public PatchedResource(string id = default(string), string name = default(string), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + { + Id = id; + Name = name; + Location = location; + Type = type; + Tags = tags; + 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 specifies the location of the resource. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private 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; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedWebService.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedWebService.cs new file mode 100644 index 0000000000000..68ea35f991893 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/PatchedWebService.cs @@ -0,0 +1,76 @@ +// +// 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.MachineLearning.WebServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Instance of an Patched Azure ML web service resource. + /// + public partial class PatchedWebService : PatchedResource + { + /// + /// Initializes a new instance of the PatchedWebService class. + /// + public PatchedWebService() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PatchedWebService class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// Contains the property payload that + /// describes the web service. + public PatchedWebService(string id = default(string), string name = default(string), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), WebServiceProperties properties = default(WebServiceProperties)) + : base(id, name, location, type, tags) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains the property payload that describes the web + /// service. + /// + [JsonProperty(PropertyName = "properties")] + public WebServiceProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ProvisioningState.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ProvisioningState.cs index 144a6fe04df46..fea33276d254a 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ProvisioningState.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ProvisioningState.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; /// /// Defines values for ProvisioningState. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/RealtimeConfiguration.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/RealtimeConfiguration.cs index 7b095d537b751..488a790fad186 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/RealtimeConfiguration.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/RealtimeConfiguration.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +25,7 @@ public partial class RealtimeConfiguration /// public RealtimeConfiguration() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Resource.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Resource.cs index 892032cfa24db..d54ffba79ab6e 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Resource.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/Resource.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Microsoft.Rest.Azure; using Newtonsoft.Json; @@ -25,7 +27,7 @@ public partial class Resource : IResource /// public Resource() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ServiceInputOutputSpecification.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ServiceInputOutputSpecification.cs index 96a77fdaf8760..476dfc87979d8 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ServiceInputOutputSpecification.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/ServiceInputOutputSpecification.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; @@ -26,7 +28,7 @@ public partial class ServiceInputOutputSpecification /// public ServiceInputOutputSpecification() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/StorageAccount.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/StorageAccount.cs index 6bbe4e0e7ee92..1a264bd9e2a86 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/StorageAccount.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/StorageAccount.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class StorageAccount /// public StorageAccount() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/TableSpecification.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/TableSpecification.cs index 5916d2486c4b1..dbe126bc73488 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/TableSpecification.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/TableSpecification.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; @@ -25,7 +27,7 @@ public partial class TableSpecification /// public TableSpecification() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebService.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebService.cs index 3b6fc2453dcac..0b56f30619650 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebService.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebService.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; @@ -24,7 +26,7 @@ public partial class WebService : Resource /// public WebService() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceKeys.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceKeys.cs index 3a1f7e8a1edcb..4b3a8a9f47185 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceKeys.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceKeys.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class WebServiceKeys /// public WebServiceKeys() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceParameter.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceParameter.cs index 545c49f699dac..e2042c2bef3bf 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceParameter.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceParameter.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Linq; @@ -21,7 +23,7 @@ public partial class WebServiceParameter /// public WebServiceParameter() { - CustomInit(); + CustomInit(); } /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceProperties.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceProperties.cs index 197cee34c8d21..759a91f89e12e 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceProperties.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServiceProperties.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -23,7 +25,7 @@ public partial class WebServiceProperties /// public WebServiceProperties() { - CustomInit(); + CustomInit(); } /// @@ -95,7 +97,7 @@ public WebServiceProperties() /// determined by adding the size of the Assets, Input, Output, /// Package, Parameters, and the ExampleRequest. /// The URI of the payload blob. This - /// paramater contains a value only if the payloadsInBlobStorage + /// parameter contains a value only if the payloadsInBlobStorage /// parameter is set to true. Otherwise is set to null. public WebServiceProperties(string title = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string provisioningState = default(string), WebServiceKeys keys = default(WebServiceKeys), bool? readOnlyProperty = default(bool?), string swaggerLocation = default(string), bool? exposeSampleData = default(bool?), RealtimeConfiguration realtimeConfiguration = default(RealtimeConfiguration), DiagnosticsConfiguration diagnostics = default(DiagnosticsConfiguration), StorageAccount storageAccount = default(StorageAccount), MachineLearningWorkspace machineLearningWorkspace = default(MachineLearningWorkspace), CommitmentPlan commitmentPlan = default(CommitmentPlan), ServiceInputOutputSpecification input = default(ServiceInputOutputSpecification), ServiceInputOutputSpecification output = default(ServiceInputOutputSpecification), ExampleRequest exampleRequest = default(ExampleRequest), IDictionary assets = default(IDictionary), IDictionary parameters = default(IDictionary), bool? payloadsInBlobStorage = default(bool?), BlobLocation payloadsLocation = default(BlobLocation)) { @@ -286,7 +288,7 @@ public WebServiceProperties() public bool? PayloadsInBlobStorage { get; set; } /// - /// Gets or sets the URI of the payload blob. This paramater contains a + /// Gets or sets the URI of the payload blob. This parameter contains a /// value only if the payloadsInBlobStorage parameter is set to true. /// Otherwise is set to null. /// diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServicePropertiesForGraph.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServicePropertiesForGraph.cs index c261e53372165..44c6f8ff079ed 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServicePropertiesForGraph.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Models/WebServicePropertiesForGraph.cs @@ -1,13 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices.Models { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; - using Microsoft.Azure.Management.MachineLearning.WebServices; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +27,7 @@ public partial class WebServicePropertiesForGraph : WebServiceProperties /// public WebServicePropertiesForGraph() { - CustomInit(); + CustomInit(); } /// @@ -98,7 +100,7 @@ public WebServicePropertiesForGraph() /// determined by adding the size of the Assets, Input, Output, /// Package, Parameters, and the ExampleRequest. /// The URI of the payload blob. This - /// paramater contains a value only if the payloadsInBlobStorage + /// parameter contains a value only if the payloadsInBlobStorage /// parameter is set to true. Otherwise is set to null. /// The definition of the graph package making up /// this web service. diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Operations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Operations.cs new file mode 100644 index 0000000000000..2a37dc75aa29f --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/Operations.cs @@ -0,0 +1,227 @@ +// +// 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.MachineLearning.WebServices +{ + 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(AzureMLWebServicesManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMLWebServicesManagementClient + /// + public AzureMLWebServicesManagementClient Client { get; private set; } + + /// + /// Lists all the available 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.MachineLearning/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/OperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/OperationsExtensions.cs new file mode 100644 index 0000000000000..3a7a8ec9b98c6 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/OperationsExtensions.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.MachineLearning.WebServices +{ + 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 the available REST API operations. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the available 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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/SdkInfo_AzureMLWebServicesManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/SdkInfo_AzureMLWebServicesManagementClient.cs new file mode 100644 index 0000000000000..462ef8a83d1ff --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/SdkInfo_AzureMLWebServicesManagementClient.cs @@ -0,0 +1,28 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearning.WebServices +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_AzureMLWebServicesManagementClient + { + get + { + return new Tuple[] + { + new Tuple("MachineLearning", "Operations", "2017-01-01"), + new Tuple("MachineLearning", "WebServices", "2017-01-01"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperations.cs index 830384b1d7815..715676d821751 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperations.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperations.cs @@ -1,12 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -302,7 +305,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) /// /// The cancellation token. /// - public async Task> PatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, WebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, PatchedWebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request AzureOperationResponse _response = await BeginPatchWithHttpMessagesAsync(resourceGroupName, webServiceName, patchPayload, customHeaders, cancellationToken).ConfigureAwait(false); @@ -733,7 +736,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -919,7 +922,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1208,7 +1211,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginPatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, WebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginPatchWithHttpMessagesAsync(string resourceGroupName, string webServiceName, PatchedWebService patchPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1706,7 +1709,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1927,7 +1930,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2100,7 +2103,7 @@ internal WebServicesOperations(AzureMLWebServicesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperationsExtensions.cs index 9d1dd4ff5507c..4c8a0cc80d3ea 100644 --- a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperationsExtensions.cs +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/WebServices/WebServicesOperationsExtensions.cs @@ -1,12 +1,15 @@ -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// +// 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.MachineLearning.WebServices { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.MachineLearning; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; @@ -139,7 +142,7 @@ public static WebService CreateOrUpdate(this IWebServicesOperations operations, /// /// The payload to use to patch the web service. /// - public static WebService Patch(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, WebService patchPayload) + public static WebService Patch(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, PatchedWebService patchPayload) { return operations.PatchAsync(resourceGroupName, webServiceName, patchPayload).GetAwaiter().GetResult(); } @@ -164,7 +167,7 @@ public static WebService Patch(this IWebServicesOperations operations, string re /// /// The cancellation token. /// - public static async Task PatchAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, WebService patchPayload, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task PatchAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, PatchedWebService patchPayload, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PatchWithHttpMessagesAsync(resourceGroupName, webServiceName, patchPayload, null, cancellationToken).ConfigureAwait(false)) { @@ -448,7 +451,7 @@ public static WebService BeginCreateOrUpdate(this IWebServicesOperations operati /// /// The payload to use to patch the web service. /// - public static WebService BeginPatch(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, WebService patchPayload) + public static WebService BeginPatch(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, PatchedWebService patchPayload) { return operations.BeginPatchAsync(resourceGroupName, webServiceName, patchPayload).GetAwaiter().GetResult(); } @@ -473,7 +476,7 @@ public static WebService BeginPatch(this IWebServicesOperations operations, stri /// /// The cancellation token. /// - public static async Task BeginPatchAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, WebService patchPayload, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginPatchAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, PatchedWebService patchPayload, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginPatchWithHttpMessagesAsync(resourceGroupName, webServiceName, patchPayload, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IMachineLearningWorkspacesManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IMachineLearningWorkspacesManagementClient.cs new file mode 100644 index 0000000000000..20956cd5db00c --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IMachineLearningWorkspacesManagementClient.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.MachineLearning.Workspaces +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// These APIs allow end users to operate on Azure Machine Learning + /// Workspace resources. They support CRUD operations for Azure Machine + /// Learning Workspaces. + /// + public partial interface IMachineLearningWorkspacesManagementClient : 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; } + + /// + /// The Microsoft Azure subscription ID. + /// + string SubscriptionId { get; set; } + + /// + /// The client API version. + /// + string ApiVersion { get; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the IWorkspacesOperations. + /// + IWorkspacesOperations Workspaces { get; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IOperations.cs new file mode 100644 index 0000000000000..e7133f305dcc6 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/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.MachineLearning.Workspaces +{ + 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 Studio 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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IWorkspacesOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IWorkspacesOperations.cs new file mode 100644 index 0000000000000..d952edf1dd7b9 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/IWorkspacesOperations.cs @@ -0,0 +1,274 @@ +// +// 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.MachineLearning.Workspaces +{ + 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. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// The name of the 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. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// The name of the 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. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// The name of the 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. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// The name of the 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)); + /// + /// Resync storage keys associated with this workspace. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// 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 ResyncStorageKeysWithHttpMessagesAsync(string workspaceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List the authorization keys associated with this workspace. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// 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> ListWorkspaceKeysWithHttpMessagesAsync(string workspaceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified resource group. + /// + /// + /// The name of the resource group to which the machine learning + /// workspace belongs. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/MachineLearningWorkspacesManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/MachineLearningWorkspacesManagementClient.cs new file mode 100644 index 0000000000000..c161ba5d6f512 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/MachineLearningWorkspacesManagementClient.cs @@ -0,0 +1,368 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearning.Workspaces +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + + /// + /// These APIs allow end users to operate on Azure Machine Learning + /// Workspace resources. They support CRUD operations for Azure Machine + /// Learning Workspaces. + /// + public partial class MachineLearningWorkspacesManagementClient : ServiceClient, IMachineLearningWorkspacesManagementClient, 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; } + + /// + /// The Microsoft Azure subscription ID. + /// + public string SubscriptionId { get; set; } + + /// + /// The client API version. + /// + public string ApiVersion { get; private set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IWorkspacesOperations. + /// + public virtual IWorkspacesOperations Workspaces { get; private set; } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling MachineLearningWorkspacesManagementClient.Dispose(). False: will not dispose provided httpClient + protected MachineLearningWorkspacesManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected MachineLearningWorkspacesManagementClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected MachineLearningWorkspacesManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient 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 MachineLearningWorkspacesManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the MachineLearningWorkspacesManagementClient 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 MachineLearningWorkspacesManagementClient(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 MachineLearningWorkspacesManagementClient 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 MachineLearningWorkspacesManagementClient(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 MachineLearningWorkspacesManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling MachineLearningWorkspacesManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public MachineLearningWorkspacesManagementClient(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 MachineLearningWorkspacesManagementClient 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 MachineLearningWorkspacesManagementClient(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 MachineLearningWorkspacesManagementClient 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 MachineLearningWorkspacesManagementClient(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 MachineLearningWorkspacesManagementClient 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 MachineLearningWorkspacesManagementClient(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); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2016-04-01"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponse.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponse.cs new file mode 100644 index 0000000000000..726875b65fd77 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponse.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.MachineLearning.Workspaces.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The error response send when an operation fails. + /// + 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 + public ErrorResponse(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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponseException.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponseException.cs new file mode 100644 index 0000000000000..b8cb0fb9cef20 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/ErrorResponseException.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.MachineLearning.Workspaces.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : 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 ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Operation.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Operation.cs new file mode 100644 index 0000000000000..56b1142d5e51e --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/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.MachineLearning.Workspaces.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure Machine Learning Studio 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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/OperationDisplay.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/OperationDisplay.cs new file mode 100644 index 0000000000000..4d7ff6ec3ac7e --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/OperationDisplay.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.MachineLearning.Workspaces.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.MachineLearning + /// 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.MachineLearning + /// + [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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Page.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Page.cs new file mode 100644 index 0000000000000..4831c9246fe73 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/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.MachineLearning.Workspaces.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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Page1.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Page1.cs new file mode 100644 index 0000000000000..ef01aaba69295 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/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.MachineLearning.Workspaces.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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Resource.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Resource.cs new file mode 100644 index 0000000000000..fb19a06a6bd06 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Resource.cs @@ -0,0 +1,102 @@ +// +// 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.MachineLearning.Workspaces.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Azure resource. + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// The location of the resource. This cannot be + /// changed after the resource is created. + /// The resource ID. + /// The name of the resource. + /// The type of the resource. + /// The tags of the resource. + public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets the location of the resource. This cannot be changed + /// after the resource is created. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets the tags of the resource. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Workspace.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Workspace.cs new file mode 100644 index 0000000000000..f2acda53a03b7 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/Workspace.cs @@ -0,0 +1,154 @@ +// +// 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.MachineLearning.Workspaces.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. + /// + /// The location of the resource. This cannot be + /// changed after the resource is created. + /// The fully qualified arm id of + /// the storage account associated with this workspace. + /// The email id of the owner for this + /// workspace. + /// The resource ID. + /// The name of the resource. + /// The type of the resource. + /// The tags of the resource. + /// The type of this workspace. Possible + /// values include: 'Production', 'Free', 'Anonymous', 'PaidStandard', + /// 'PaidPremium' + /// The current state of workspace + /// resource. Possible values include: 'Deleted', 'Enabled', + /// 'Disabled', 'Migrated', 'Updated', 'Registered', + /// 'Unregistered' + /// The immutable id associated with this + /// workspace. + /// The creation time for this workspace + /// resource. + /// The regional endpoint for the machine + /// learning studio service which hosts this workspace. + /// The key vault identifier used + /// for encrypted workspaces. + public Workspace(string location, string userStorageAccountId, string ownerEmail, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), WorkspaceType? workspaceType = default(WorkspaceType?), WorkspaceState? workspaceState = default(WorkspaceState?), string workspaceId = default(string), string creationTime = default(string), string studioEndpoint = default(string), string keyVaultIdentifierId = default(string)) + : base(location, id, name, type, tags) + { + UserStorageAccountId = userStorageAccountId; + OwnerEmail = ownerEmail; + WorkspaceType = workspaceType; + WorkspaceState = workspaceState; + WorkspaceId = workspaceId; + CreationTime = creationTime; + StudioEndpoint = studioEndpoint; + KeyVaultIdentifierId = keyVaultIdentifierId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the fully qualified arm id of the storage account + /// associated with this workspace. + /// + [JsonProperty(PropertyName = "properties.userStorageAccountId")] + public string UserStorageAccountId { get; set; } + + /// + /// Gets or sets the email id of the owner for this workspace. + /// + [JsonProperty(PropertyName = "properties.ownerEmail")] + public string OwnerEmail { get; set; } + + /// + /// Gets the type of this workspace. Possible values include: + /// 'Production', 'Free', 'Anonymous', 'PaidStandard', 'PaidPremium' + /// + [JsonProperty(PropertyName = "properties.workspaceType")] + public WorkspaceType? WorkspaceType { get; private set; } + + /// + /// Gets the current state of workspace resource. Possible values + /// include: 'Deleted', 'Enabled', 'Disabled', 'Migrated', 'Updated', + /// 'Registered', 'Unregistered' + /// + [JsonProperty(PropertyName = "properties.workspaceState")] + public WorkspaceState? WorkspaceState { get; private set; } + + /// + /// Gets the immutable id associated with this workspace. + /// + [JsonProperty(PropertyName = "properties.workspaceId")] + public string WorkspaceId { get; private set; } + + /// + /// Gets the creation time for this workspace resource. + /// + [JsonProperty(PropertyName = "properties.creationTime")] + public string CreationTime { get; private set; } + + /// + /// Gets the regional endpoint for the machine learning studio service + /// which hosts this workspace. + /// + [JsonProperty(PropertyName = "properties.studioEndpoint")] + public string StudioEndpoint { get; private set; } + + /// + /// Gets or sets the key vault identifier used for encrypted + /// workspaces. + /// + [JsonProperty(PropertyName = "properties.keyVaultIdentifierId")] + public string KeyVaultIdentifierId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (UserStorageAccountId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "UserStorageAccountId"); + } + if (OwnerEmail == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "OwnerEmail"); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceKeysResponse.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceKeysResponse.cs new file mode 100644 index 0000000000000..f7d53d57cd6dd --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceKeysResponse.cs @@ -0,0 +1,61 @@ +// +// 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.MachineLearning.Workspaces.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Workspace authorization keys for a workspace. + /// + public partial class WorkspaceKeysResponse + { + /// + /// Initializes a new instance of the WorkspaceKeysResponse class. + /// + public WorkspaceKeysResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceKeysResponse class. + /// + /// Primary authorization key for this + /// workspace. + /// Secondary authorization key for this + /// workspace. + public WorkspaceKeysResponse(string primaryToken = default(string), string secondaryToken = default(string)) + { + PrimaryToken = primaryToken; + SecondaryToken = secondaryToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets primary authorization key for this workspace. + /// + [JsonProperty(PropertyName = "primaryToken")] + public string PrimaryToken { get; set; } + + /// + /// Gets or sets secondary authorization key for this workspace. + /// + [JsonProperty(PropertyName = "secondaryToken")] + public string SecondaryToken { get; set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceState.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceState.cs new file mode 100644 index 0000000000000..7397c093770af --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceState.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.MachineLearning.Workspaces.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for WorkspaceState. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum WorkspaceState + { + [EnumMember(Value = "Deleted")] + Deleted, + [EnumMember(Value = "Enabled")] + Enabled, + [EnumMember(Value = "Disabled")] + Disabled, + [EnumMember(Value = "Migrated")] + Migrated, + [EnumMember(Value = "Updated")] + Updated, + [EnumMember(Value = "Registered")] + Registered, + [EnumMember(Value = "Unregistered")] + Unregistered + } + internal static class WorkspaceStateEnumExtension + { + internal static string ToSerializedValue(this WorkspaceState? value) + { + return value == null ? null : ((WorkspaceState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this WorkspaceState value) + { + switch( value ) + { + case WorkspaceState.Deleted: + return "Deleted"; + case WorkspaceState.Enabled: + return "Enabled"; + case WorkspaceState.Disabled: + return "Disabled"; + case WorkspaceState.Migrated: + return "Migrated"; + case WorkspaceState.Updated: + return "Updated"; + case WorkspaceState.Registered: + return "Registered"; + case WorkspaceState.Unregistered: + return "Unregistered"; + } + return null; + } + + internal static WorkspaceState? ParseWorkspaceState(this string value) + { + switch( value ) + { + case "Deleted": + return WorkspaceState.Deleted; + case "Enabled": + return WorkspaceState.Enabled; + case "Disabled": + return WorkspaceState.Disabled; + case "Migrated": + return WorkspaceState.Migrated; + case "Updated": + return WorkspaceState.Updated; + case "Registered": + return WorkspaceState.Registered; + case "Unregistered": + return WorkspaceState.Unregistered; + } + return null; + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceType.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceType.cs new file mode 100644 index 0000000000000..697dc69f94399 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceType.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.MachineLearning.Workspaces.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for WorkspaceType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum WorkspaceType + { + [EnumMember(Value = "Production")] + Production, + [EnumMember(Value = "Free")] + Free, + [EnumMember(Value = "Anonymous")] + Anonymous, + [EnumMember(Value = "PaidStandard")] + PaidStandard, + [EnumMember(Value = "PaidPremium")] + PaidPremium + } + internal static class WorkspaceTypeEnumExtension + { + internal static string ToSerializedValue(this WorkspaceType? value) + { + return value == null ? null : ((WorkspaceType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this WorkspaceType value) + { + switch( value ) + { + case WorkspaceType.Production: + return "Production"; + case WorkspaceType.Free: + return "Free"; + case WorkspaceType.Anonymous: + return "Anonymous"; + case WorkspaceType.PaidStandard: + return "PaidStandard"; + case WorkspaceType.PaidPremium: + return "PaidPremium"; + } + return null; + } + + internal static WorkspaceType? ParseWorkspaceType(this string value) + { + switch( value ) + { + case "Production": + return WorkspaceType.Production; + case "Free": + return WorkspaceType.Free; + case "Anonymous": + return WorkspaceType.Anonymous; + case "PaidStandard": + return WorkspaceType.PaidStandard; + case "PaidPremium": + return WorkspaceType.PaidPremium; + } + return null; + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceUpdateParameters.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceUpdateParameters.cs new file mode 100644 index 0000000000000..490d970fdb71f --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Models/WorkspaceUpdateParameters.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.MachineLearning.Workspaces.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 current state of workspace + /// resource. Possible values include: 'Deleted', 'Enabled', + /// 'Disabled', 'Migrated', 'Updated', 'Registered', + /// 'Unregistered' + /// The key vault identifier used + /// for encrypted workspaces. + public WorkspaceUpdateParameters(IDictionary tags = default(IDictionary), WorkspaceState? workspaceState = default(WorkspaceState?), string keyVaultIdentifierId = default(string)) + { + Tags = tags; + WorkspaceState = workspaceState; + KeyVaultIdentifierId = keyVaultIdentifierId; + 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 current state of workspace resource. Possible + /// values include: 'Deleted', 'Enabled', 'Disabled', 'Migrated', + /// 'Updated', 'Registered', 'Unregistered' + /// + [JsonProperty(PropertyName = "properties.workspaceState")] + public WorkspaceState? WorkspaceState { get; set; } + + /// + /// Gets or sets the key vault identifier used for encrypted + /// workspaces. + /// + [JsonProperty(PropertyName = "properties.keyVaultIdentifierId")] + public string KeyVaultIdentifierId { get; set; } + + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Operations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/Operations.cs new file mode 100644 index 0000000000000..06893bf1b75c2 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/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.MachineLearning.Workspaces +{ + 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(MachineLearningWorkspacesManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the MachineLearningWorkspacesManagementClient + /// + public MachineLearningWorkspacesManagementClient Client { get; private set; } + + /// + /// Lists all of the available Azure Machine Learning Studio 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.MachineLearning/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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/OperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/OperationsExtensions.cs new file mode 100644 index 0000000000000..319c893bb01ad --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/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.MachineLearning.Workspaces +{ + 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 Studio 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 Studio 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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/SdkInfo_MachineLearningWorkspacesManagementClient.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/SdkInfo_MachineLearningWorkspacesManagementClient.cs new file mode 100644 index 0000000000000..9d1d92314e013 --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/SdkInfo_MachineLearningWorkspacesManagementClient.cs @@ -0,0 +1,28 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearning.Workspaces +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_MachineLearningWorkspacesManagementClient + { + get + { + return new Tuple[] + { + new Tuple("MachineLearning", "Operations", "2016-04-01"), + new Tuple("MachineLearning", "Workspaces", "2016-04-01"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperations.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperations.cs new file mode 100644 index 0000000000000..6d5a6e5971c9d --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperations.cs @@ -0,0 +1,1892 @@ +// +// 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.MachineLearning.Workspaces +{ + 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(MachineLearningWorkspacesManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the MachineLearningWorkspacesManagementClient + /// + public MachineLearningWorkspacesManagementClient Client { get; private set; } + + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the 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.MachineLearning/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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _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. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the 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> CreateOrUpdateWithHttpMessagesAsync(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, "CreateOrUpdate", 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.MachineLearning/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) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _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 a machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the 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 DeleteWithHttpMessagesAsync(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, "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.MachineLearning/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 != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _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; + } + + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the 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.MachineLearning/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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _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 storage keys associated with this workspace. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// 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 ResyncStorageKeysWithHttpMessagesAsync(string workspaceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + 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("workspaceName", workspaceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ResyncStorageKeys", 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.MachineLearning/workspaces/{workspaceName}/resyncStorageKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _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; + } + + /// + /// List the authorization keys associated with this workspace. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// 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> ListWorkspaceKeysWithHttpMessagesAsync(string workspaceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + 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("workspaceName", workspaceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListWorkspaceKeys", 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.MachineLearning/workspaces/{workspaceName}/listWorkspaceKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _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. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/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 (_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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _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. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/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 (_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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _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. + /// + /// + /// 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _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>> 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _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/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperationsExtensions.cs b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperationsExtensions.cs new file mode 100644 index 0000000000000..bbf1605cc9d0d --- /dev/null +++ b/sdk/machinelearning/Microsoft.Azure.Management.MachineLearning/src/Generated/Workspaces/WorkspacesOperationsExtensions.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.MachineLearning.Workspaces +{ + 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. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the 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. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the 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. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the 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. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the 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. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the 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. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the 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. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the 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. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The name of the 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; + } + } + + /// + /// Resync storage keys associated with this workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + public static void ResyncStorageKeys(this IWorkspacesOperations operations, string workspaceName, string resourceGroupName) + { + operations.ResyncStorageKeysAsync(workspaceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Resync storage keys associated with this workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The cancellation token. + /// + public static async Task ResyncStorageKeysAsync(this IWorkspacesOperations operations, string workspaceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ResyncStorageKeysWithHttpMessagesAsync(workspaceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List the authorization keys associated with this workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + public static WorkspaceKeysResponse ListWorkspaceKeys(this IWorkspacesOperations operations, string workspaceName, string resourceGroupName) + { + return operations.ListWorkspaceKeysAsync(workspaceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// List the authorization keys associated with this workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the machine learning workspace. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The cancellation token. + /// + public static async Task ListWorkspaceKeysAsync(this IWorkspacesOperations operations, string workspaceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWorkspaceKeysWithHttpMessagesAsync(workspaceName, resourceGroupName, 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. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + public static IPage ListByResourceGroup(this IWorkspacesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the machine learning workspace + /// belongs. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IWorkspacesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, 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. + /// + public static IPage List(this IWorkspacesOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWorkspacesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(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. + /// + /// + /// 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 ListNext(this IWorkspacesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(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> ListNextAsync(this IWorkspacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}