From d8c30597b7362c1ac9b834d6aca0c66b6bc2de02 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 4 Jun 2020 22:07:21 +0000 Subject: [PATCH] Update from master --- .../AzureMachineLearningWorkspacesClient.cs | 758 +++++++ ...chineLearningWorkspacesClientExtensions.cs | 87 + .../IAzureMachineLearningWorkspacesClient.cs | 148 ++ .../IMachineLearningComputeOperations.cs | 357 +++ .../src/Generated/IOperations.cs | 47 + .../IPrivateEndpointConnectionsOperations.cs | 117 + .../IPrivateLinkResourcesOperations.cs | 53 + .../src/Generated/IQuotasOperations.cs | 96 + .../src/Generated/IUsagesOperations.cs | 73 + .../IVirtualMachineSizesOperations.cs | 49 + .../Generated/IWorkspaceFeaturesOperations.cs | 74 + .../src/Generated/IWorkspacesOperations.cs | 306 +++ .../MachineLearningComputeOperations.cs | 1784 +++++++++++++++ ...hineLearningComputeOperationsExtensions.cs | 579 +++++ .../src/Generated/Models/AKS.cs | 86 + .../src/Generated/Models/AKSProperties.cs | 113 + .../src/Generated/Models/AksComputeSecrets.cs | 73 + .../Models/AksNetworkingConfiguration.cs | 119 + .../src/Generated/Models/AllocationState.cs | 22 + .../src/Generated/Models/AmlCompute.cs | 86 + .../Models/AmlComputeNodeInformation.cs | 112 + .../Models/AmlComputeNodesInformation.cs | 57 + .../Generated/Models/AmlComputeProperties.cs | 215 ++ .../src/Generated/Models/AmlUserFeature.cs | 68 + .../Models/ClusterUpdateParameters.cs | 70 + .../src/Generated/Models/Compute.cs | 125 ++ .../Models/ComputeNodesInformation.cs | 53 + .../src/Generated/Models/ComputeResource.cs | 73 + .../src/Generated/Models/ComputeSecrets.cs | 38 + .../src/Generated/Models/ComputeType.cs | 27 + .../src/Generated/Models/DataFactory.cs | 65 + .../src/Generated/Models/DataLakeAnalytics.cs | 71 + .../Models/DataLakeAnalyticsProperties.cs | 51 + .../src/Generated/Models/Databricks.cs | 71 + .../Models/DatabricksComputeSecrets.cs | 53 + .../Generated/Models/DatabricksProperties.cs | 48 + .../Generated/Models/EncryptionProperty.cs | 82 + .../src/Generated/Models/EncryptionStatus.cs | 22 + .../src/Generated/Models/ErrorDetail.cs | 77 + .../src/Generated/Models/ErrorResponse.cs | 69 + .../Models/ErrorResponseException.cs | 62 + .../src/Generated/Models/HDInsight.cs | 71 + .../Generated/Models/HDInsightProperties.cs | 68 + .../src/Generated/Models/Identity.cs | 97 + .../IdentityUserAssignedIdentitiesValue.cs | 60 + .../Generated/Models/KeyVaultProperties.cs | 87 + .../Models/ListWorkspaceKeysResult.cs | 64 + ...ineLearningComputeCreateOrUpdateHeaders.cs | 54 + .../MachineLearningComputeDeleteHeaders.cs | 63 + .../Models/MachineLearningServiceError.cs | 53 + .../MachineLearningServiceErrorException.cs | 62 + .../src/Generated/Models/NodeState.cs | 26 + .../src/Generated/Models/NodeStateCounts.cs | 109 + .../src/Generated/Models/Operation.cs | 60 + .../src/Generated/Models/OperationDisplay.cs | 80 + .../src/Generated/Models/Page.cs | 53 + .../src/Generated/Models/Page1.cs | 53 + .../src/Generated/Models/Password.cs | 52 + .../src/Generated/Models/PrivateEndpoint.cs | 51 + .../Models/PrivateEndpointConnection.cs | 104 + ...vateEndpointConnectionProvisioningState.cs | 24 + .../PrivateEndpointServiceConnectionStatus.cs | 25 + .../Generated/Models/PrivateLinkResource.cs | 94 + .../Models/PrivateLinkResourceListResult.cs | 55 + .../PrivateLinkServiceConnectionState.cs | 79 + .../src/Generated/Models/ProvisioningState.cs | 27 + .../Generated/Models/QuotaBaseProperties.cs | 80 + .../src/Generated/Models/QuotaUnit.cs | 21 + .../Generated/Models/QuotaUpdateParameters.cs | 53 + .../src/Generated/Models/ReasonCode.cs | 23 + .../Models/RegistryListCredentialsResult.cs | 62 + .../Models/RemoteLoginPortPublicAccess.cs | 23 + .../src/Generated/Models/Resource.cs | 118 + .../src/Generated/Models/ResourceId.cs | 67 + .../Generated/Models/ResourceIdentityType.cs | 72 + .../src/Generated/Models/ResourceName.cs | 60 + .../src/Generated/Models/ResourceQuota.cs | 88 + .../Models/ResourceSkuLocationInfo.cs | 68 + .../Models/ResourceSkuZoneDetails.cs | 65 + .../src/Generated/Models/Restriction.cs | 79 + .../src/Generated/Models/SKUCapability.cs | 59 + .../src/Generated/Models/ScaleSettings.cs | 78 + .../Models/ServicePrincipalCredentials.cs | 79 + .../Models/SharedPrivateLinkResource.cs | 90 + .../src/Generated/Models/Sku.cs | 59 + .../src/Generated/Models/SslConfiguration.cs | 77 + .../src/Generated/Models/Status.cs | 28 + .../src/Generated/Models/SystemService.cs | 68 + .../Models/UnderlyingResourceAction.cs | 22 + .../Generated/Models/UpdateWorkspaceQuotas.cs | 95 + .../Models/UpdateWorkspaceQuotasResult.cs | 68 + .../src/Generated/Models/Usage.cs | 95 + .../src/Generated/Models/UsageName.cs | 60 + .../src/Generated/Models/UsageUnit.cs | 21 + .../Models/UserAccountCredentials.cs | 92 + .../src/Generated/Models/VirtualMachine.cs | 71 + .../Models/VirtualMachineProperties.cs | 74 + .../Generated/Models/VirtualMachineSecrets.cs | 53 + .../Generated/Models/VirtualMachineSize.cs | 143 ++ .../Models/VirtualMachineSizeListResult.cs | 57 + .../Models/VirtualMachineSshCredentials.cs | 77 + .../src/Generated/Models/VmPriority.cs | 22 + .../src/Generated/Models/Workspace.cs | 272 +++ .../src/Generated/Models/WorkspaceSku.cs | 106 + .../Models/WorkspaceUpdateParameters.cs | 83 + .../src/Generated/Operations.cs | 223 ++ .../src/Generated/OperationsExtensions.cs | 57 + .../PrivateEndpointConnectionsOperations.cs | 654 ++++++ ...EndpointConnectionsOperationsExtensions.cs | 172 ++ .../PrivateLinkResourcesOperations.cs | 250 +++ ...rivateLinkResourcesOperationsExtensions.cs | 65 + .../src/Generated/QuotasOperations.cs | 624 ++++++ .../Generated/QuotasOperationsExtensions.cs | 133 ++ .../SdkInfo_AzureMachineLearningWorkspaces.cs | 36 + .../src/Generated/UsagesOperations.cs | 423 ++++ .../Generated/UsagesOperationsExtensions.cs | 97 + .../VirtualMachineSizesOperations.cs | 248 +++ ...VirtualMachineSizesOperationsExtensions.cs | 59 + .../Generated/WorkspaceFeaturesOperations.cs | 413 ++++ .../WorkspaceFeaturesOperationsExtensions.cs | 99 + .../src/Generated/WorkspacesOperations.cs | 1946 +++++++++++++++++ .../WorkspacesOperationsExtensions.cs | 471 ++++ 122 files changed, 16905 insertions(+) create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClient.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClientExtensions.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IAzureMachineLearningWorkspacesClient.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IMachineLearningComputeOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateEndpointConnectionsOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateLinkResourcesOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IQuotasOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IUsagesOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IVirtualMachineSizesOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceFeaturesOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspacesOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperationsExtensions.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKS.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKSProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksComputeSecrets.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksNetworkingConfiguration.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AllocationState.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlCompute.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodeInformation.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodesInformation.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlUserFeature.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ClusterUpdateParameters.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Compute.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeNodesInformation.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeResource.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeSecrets.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeType.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataFactory.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalytics.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalyticsProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Databricks.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksComputeSecrets.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionProperty.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionStatus.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorDetail.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorResponse.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorResponseException.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsight.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsightProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Identity.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/IdentityUserAssignedIdentitiesValue.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KeyVaultProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListWorkspaceKeysResult.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeCreateOrUpdateHeaders.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeDeleteHeaders.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceError.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceErrorException.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeState.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeStateCounts.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Operation.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationDisplay.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page1.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Password.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpoint.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnection.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResource.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResourceListResult.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkServiceConnectionState.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaBaseProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUnit.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUpdateParameters.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ReasonCode.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RegistryListCredentialsResult.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RemoteLoginPortPublicAccess.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Resource.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceId.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceIdentityType.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceName.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceQuota.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuLocationInfo.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuZoneDetails.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Restriction.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SKUCapability.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScaleSettings.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ServicePrincipalCredentials.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SharedPrivateLinkResource.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Sku.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SslConfiguration.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Status.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SystemService.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UnderlyingResourceAction.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotas.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotasResult.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Usage.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageName.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageUnit.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UserAccountCredentials.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachine.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSecrets.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSize.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSizeListResult.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSshCredentials.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VmPriority.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Workspace.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceSku.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceUpdateParameters.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Operations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/OperationsExtensions.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperationsExtensions.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperationsExtensions.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/SdkInfo_AzureMachineLearningWorkspaces.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperationsExtensions.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperationsExtensions.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperationsExtensions.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperationsExtensions.cs diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClient.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClient.cs new file mode 100644 index 0000000000000..17d8dedf03aa9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClient.cs @@ -0,0 +1,758 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// These APIs allow end users to operate on Azure Machine Learning + /// Workspace resources. + /// + public partial class AzureMachineLearningWorkspacesClient : ServiceClient, IAzureMachineLearningWorkspacesClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// Azure subscription identifier. + /// + public string SubscriptionId { get; set; } + + /// + /// Version of Azure Machine Learning resource provider API. + /// + public string ApiVersion { get; private set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IWorkspacesOperations. + /// + public virtual IWorkspacesOperations Workspaces { get; private set; } + + /// + /// Gets the IWorkspaceFeaturesOperations. + /// + public virtual IWorkspaceFeaturesOperations WorkspaceFeatures { get; private set; } + + /// + /// Gets the IUsagesOperations. + /// + public virtual IUsagesOperations Usages { get; private set; } + + /// + /// Gets the IVirtualMachineSizesOperations. + /// + public virtual IVirtualMachineSizesOperations VirtualMachineSizes { get; private set; } + + /// + /// Gets the IQuotasOperations. + /// + public virtual IQuotasOperations Quotas { get; private set; } + + /// + /// Gets the IMachineLearningComputeOperations. + /// + public virtual IMachineLearningComputeOperations MachineLearningCompute { get; private set; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureMachineLearningWorkspacesClient.Dispose(). False: will not dispose provided httpClient + protected AzureMachineLearningWorkspacesClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected AzureMachineLearningWorkspacesClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected AzureMachineLearningWorkspacesClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected AzureMachineLearningWorkspacesClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected AzureMachineLearningWorkspacesClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public AzureMachineLearningWorkspacesClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureMachineLearningWorkspacesClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public AzureMachineLearningWorkspacesClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public AzureMachineLearningWorkspacesClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public AzureMachineLearningWorkspacesClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the AzureMachineLearningWorkspacesClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public AzureMachineLearningWorkspacesClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + Operations = new Operations(this); + Workspaces = new WorkspacesOperations(this); + WorkspaceFeatures = new WorkspaceFeaturesOperations(this); + Usages = new UsagesOperations(this); + VirtualMachineSizes = new VirtualMachineSizesOperations(this); + Quotas = new QuotasOperations(this); + MachineLearningCompute = new MachineLearningComputeOperations(this); + PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); + PrivateLinkResources = new PrivateLinkResourcesOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2020-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() + } + }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("computeType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("computeType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("computeType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("computeType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("computeType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("computeType")); + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + /// + /// Lists all skus with associated features + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListSkusWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSkus", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces/skus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all skus with associated features + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListSkusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSkusNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClientExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClientExtensions.cs new file mode 100644 index 0000000000000..0aa5b14300e72 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClientExtensions.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for AzureMachineLearningWorkspacesClient. + /// + public static partial class AzureMachineLearningWorkspacesClientExtensions + { + /// + /// Lists all skus with associated features + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListSkus(this IAzureMachineLearningWorkspacesClient operations) + { + return operations.ListSkusAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all skus with associated features + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListSkusAsync(this IAzureMachineLearningWorkspacesClient operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSkusWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all skus with associated features + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListSkusNext(this IAzureMachineLearningWorkspacesClient operations, string nextPageLink) + { + return operations.ListSkusNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all skus with associated features + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListSkusNextAsync(this IAzureMachineLearningWorkspacesClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSkusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IAzureMachineLearningWorkspacesClient.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IAzureMachineLearningWorkspacesClient.cs new file mode 100644 index 0000000000000..555bf9c272b91 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IAzureMachineLearningWorkspacesClient.cs @@ -0,0 +1,148 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// These APIs allow end users to operate on Azure Machine Learning + /// Workspace resources. + /// + public partial interface IAzureMachineLearningWorkspacesClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// Azure subscription identifier. + /// + string SubscriptionId { get; set; } + + /// + /// Version of Azure Machine Learning resource provider API. + /// + string ApiVersion { get; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the IWorkspacesOperations. + /// + IWorkspacesOperations Workspaces { get; } + + /// + /// Gets the IWorkspaceFeaturesOperations. + /// + IWorkspaceFeaturesOperations WorkspaceFeatures { get; } + + /// + /// Gets the IUsagesOperations. + /// + IUsagesOperations Usages { get; } + + /// + /// Gets the IVirtualMachineSizesOperations. + /// + IVirtualMachineSizesOperations VirtualMachineSizes { get; } + + /// + /// Gets the IQuotasOperations. + /// + IQuotasOperations Quotas { get; } + + /// + /// Gets the IMachineLearningComputeOperations. + /// + IMachineLearningComputeOperations MachineLearningCompute { get; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + IPrivateLinkResourcesOperations PrivateLinkResources { get; } + + /// + /// Lists all skus with associated features + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListSkusWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists all skus with associated features + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListSkusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IMachineLearningComputeOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IMachineLearningComputeOperations.cs new file mode 100644 index 0000000000000..146aea737dcdb --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IMachineLearningComputeOperations.cs @@ -0,0 +1,357 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MachineLearningComputeOperations operations. + /// + public partial interface IMachineLearningComputeOperations + { + /// + /// Gets computes in specified workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Continuation token for pagination. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets compute definition by its name. Any secrets (storage keys, + /// service credentials, etc) are not returned - use 'keys' nested + /// resource to get them. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates compute. This call will overwrite a compute if + /// it exists. This is a nonrecoverable operation. If your intent is to + /// create a new compute, do a GET first to verify that it does not + /// exist yet. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates properties of a compute. This call will overwrite a compute + /// if it exists. This is a nonrecoverable operation. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying + /// compute from workspace if 'Detach'. Possible values include: + /// 'Delete', 'Detach' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the details (e.g IP address, port etc) of all the compute nodes + /// in the compute. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListNodesWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets secrets related to Machine Learning compute (storage keys, + /// service credentials, etc). + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates compute. This call will overwrite a compute if + /// it exists. This is a nonrecoverable operation. If your intent is to + /// create a new compute, do a GET first to verify that it does not + /// exist yet. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates properties of a compute. This call will overwrite a compute + /// if it exists. This is a nonrecoverable operation. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying + /// compute from workspace if 'Detach'. Possible values include: + /// 'Delete', 'Detach' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets computes in specified workspace. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IOperations.cs new file mode 100644 index 0000000000000..ff0615daf4769 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IOperations.cs @@ -0,0 +1,47 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available Azure Machine Learning Workspaces REST + /// API operations. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateEndpointConnectionsOperations.cs new file mode 100644 index 0000000000000..03eca39faf1f7 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -0,0 +1,117 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + public partial interface IPrivateEndpointConnectionsOperations + { + /// + /// Gets the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the + /// workspace + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the state of specified private endpoint connection + /// associated with the workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the + /// workspace + /// + /// + /// The private endpoint connection properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PutWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string privateEndpointConnectionName, PrivateEndpointConnection properties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified private endpoint connection associated with + /// the workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the + /// workspace + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateLinkResourcesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateLinkResourcesOperations.cs new file mode 100644 index 0000000000000..084ed9f9238bb --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateLinkResourcesOperations.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateLinkResourcesOperations operations. + /// + public partial interface IPrivateLinkResourcesOperations + { + /// + /// Gets the private link resources that need to be created for a + /// workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IQuotasOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IQuotasOperations.cs new file mode 100644 index 0000000000000..0380e47ac2019 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IQuotasOperations.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// QuotasOperations operations. + /// + public partial interface IQuotasOperations + { + /// + /// Update quota for each VM family in workspace. + /// + /// + /// The location for update quota is queried. + /// + /// + /// Quota update parameters. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string location, QuotaUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IUsagesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IUsagesOperations.cs new file mode 100644 index 0000000000000..6864e81d92e6f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IUsagesOperations.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// UsagesOperations operations. + /// + public partial interface IUsagesOperations + { + /// + /// Gets the current usage information as well as limits for AML + /// resources for given subscription and location. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the current usage information as well as limits for AML + /// resources for given subscription and location. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IVirtualMachineSizesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IVirtualMachineSizesOperations.cs new file mode 100644 index 0000000000000..08c5562882ffd --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IVirtualMachineSizesOperations.cs @@ -0,0 +1,49 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// VirtualMachineSizesOperations operations. + /// + public partial interface IVirtualMachineSizesOperations + { + /// + /// Returns supported VM Sizes in a location + /// + /// + /// The location upon which virtual-machine-sizes is queried. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceFeaturesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceFeaturesOperations.cs new file mode 100644 index 0000000000000..2eacab3a4dd44 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceFeaturesOperations.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspaceFeaturesOperations operations. + /// + public partial interface IWorkspaceFeaturesOperations + { + /// + /// Lists all enabled features for a workspace + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all enabled features for a workspace + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspacesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspacesOperations.cs new file mode 100644 index 0000000000000..0057e6c2525e9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspacesOperations.cs @@ -0,0 +1,306 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspacesOperations operations. + /// + public partial interface IWorkspacesOperations + { + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning + /// workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a machine learning workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for updating a machine learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspaceUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified resource group. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Continuation token for pagination. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the keys associated with this workspace. This includes + /// keys for the storage account, app insights and password for + /// container registry + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Resync all the keys associated with this workspace. This includes + /// keys for the storage account, app insights and password for + /// container registry + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ResyncKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified subscription. + /// + /// + /// Continuation token for pagination. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySubscriptionWithHttpMessagesAsync(string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning + /// workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperations.cs new file mode 100644 index 0000000000000..e142a15ed0488 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperations.cs @@ -0,0 +1,1784 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MachineLearningComputeOperations operations. + /// + internal partial class MachineLearningComputeOperations : IServiceOperations, IMachineLearningComputeOperations + { + /// + /// Initializes a new instance of the MachineLearningComputeOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal MachineLearningComputeOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Gets computes in specified workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Continuation token for pagination. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("skiptoken", skiptoken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets compute definition by its name. Any secrets (storage keys, service + /// credentials, etc) are not returned - use 'keys' nested resource to get + /// them. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates properties of a compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying compute + /// from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the details (e.g IP address, port etc) of all the compute nodes in the + /// compute. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListNodesWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNodes", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets secrets related to Machine Learning compute (storage keys, service + /// credentials, etc). + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates properties of a compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying compute + /// from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (computeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "computeName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (underlyingResourceAction == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "underlyingResourceAction"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("computeName", computeName); + tracingParameters.Add("underlyingResourceAction", underlyingResourceAction); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (underlyingResourceAction != null) + { + _queryParameters.Add(string.Format("underlyingResourceAction={0}", System.Uri.EscapeDataString(underlyingResourceAction))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets computes in specified workspace. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspaceNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperationsExtensions.cs new file mode 100644 index 0000000000000..032826a8ac88e --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/MachineLearningComputeOperationsExtensions.cs @@ -0,0 +1,579 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for MachineLearningComputeOperations. + /// + public static partial class MachineLearningComputeOperationsExtensions + { + /// + /// Gets computes in specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Continuation token for pagination. + /// + public static IPage ListByWorkspace(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string skiptoken = default(string)) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName, skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Gets computes in specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Continuation token for pagination. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets compute definition by its name. Any secrets (storage keys, service + /// credentials, etc) are not returned - use 'keys' nested resource to get + /// them. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static ComputeResource Get(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + return operations.GetAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Gets compute definition by its name. Any secrets (storage keys, service + /// credentials, etc) are not returned - use 'keys' nested resource to get + /// them. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + public static ComputeResource CreateOrUpdate(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates properties of a compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + public static ComputeResource Update(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, computeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates properties of a compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying compute + /// from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' + /// + public static MachineLearningComputeDeleteHeaders Delete(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction) + { + return operations.DeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction).GetAwaiter().GetResult(); + } + + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying compute + /// from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// Get the details (e.g IP address, port etc) of all the compute nodes in the + /// compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static AmlComputeNodesInformation ListNodes(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + return operations.ListNodesAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Get the details (e.g IP address, port etc) of all the compute nodes in the + /// compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task ListNodesAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNodesWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets secrets related to Machine Learning compute (storage keys, service + /// credentials, etc). + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static ComputeSecrets ListKeys(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + return operations.ListKeysAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Gets secrets related to Machine Learning compute (storage keys, service + /// credentials, etc). + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task ListKeysAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + public static ComputeResource BeginCreateOrUpdate(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ComputeResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates properties of a compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + public static ComputeResource BeginUpdate(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, workspaceName, computeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates properties of a compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, ClusterUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying compute + /// from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' + /// + public static MachineLearningComputeDeleteHeaders BeginDelete(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction) + { + return operations.BeginDeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction).GetAwaiter().GetResult(); + } + + /// + /// Deletes specified Machine Learning compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Delete the underlying compute if 'Delete', or detach the underlying compute + /// from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IMachineLearningComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, string underlyingResourceAction, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// Gets computes in specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByWorkspaceNext(this IMachineLearningComputeOperations operations, string nextPageLink) + { + return operations.ListByWorkspaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets computes in specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceNextAsync(this IMachineLearningComputeOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKS.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKS.cs new file mode 100644 index 0000000000000..8fb80d0937651 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKS.cs @@ -0,0 +1,86 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A Machine Learning compute based on AKS. + /// + [Newtonsoft.Json.JsonObject("AKS")] + public partial class AKS : Compute + { + /// + /// Initializes a new instance of the AKS class. + /// + public AKS() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AKS class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + /// AKS properties + public AKS(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), AKSProperties properties = default(AKSProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets AKS properties + /// + [JsonProperty(PropertyName = "properties")] + public AKSProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKSProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKSProperties.cs new file mode 100644 index 0000000000000..0db36a5166297 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKSProperties.cs @@ -0,0 +1,113 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AKS properties + /// + public partial class AKSProperties + { + /// + /// Initializes a new instance of the AKSProperties class. + /// + public AKSProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AKSProperties class. + /// + /// Cluster full qualified domain + /// name + /// System services + /// Number of agents + /// Agent virtual machine size + /// SSL configuration + /// AKS networking + /// configuration for vnet + public AKSProperties(string clusterFqdn = default(string), IList systemServices = default(IList), int? agentCount = default(int?), string agentVMSize = default(string), SslConfiguration sslConfiguration = default(SslConfiguration), AksNetworkingConfiguration aksNetworkingConfiguration = default(AksNetworkingConfiguration)) + { + ClusterFqdn = clusterFqdn; + SystemServices = systemServices; + AgentCount = agentCount; + AgentVMSize = agentVMSize; + SslConfiguration = sslConfiguration; + AksNetworkingConfiguration = aksNetworkingConfiguration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets cluster full qualified domain name + /// + [JsonProperty(PropertyName = "clusterFqdn")] + public string ClusterFqdn { get; set; } + + /// + /// Gets system services + /// + [JsonProperty(PropertyName = "systemServices")] + public IList SystemServices { get; private set; } + + /// + /// Gets or sets number of agents + /// + [JsonProperty(PropertyName = "agentCount")] + public int? AgentCount { get; set; } + + /// + /// Gets or sets agent virtual machine size + /// + [JsonProperty(PropertyName = "agentVMSize")] + public string AgentVMSize { get; set; } + + /// + /// Gets or sets SSL configuration + /// + [JsonProperty(PropertyName = "sslConfiguration")] + public SslConfiguration SslConfiguration { get; set; } + + /// + /// Gets or sets AKS networking configuration for vnet + /// + [JsonProperty(PropertyName = "aksNetworkingConfiguration")] + public AksNetworkingConfiguration AksNetworkingConfiguration { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AgentCount < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "AgentCount", 1); + } + if (AksNetworkingConfiguration != null) + { + AksNetworkingConfiguration.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksComputeSecrets.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksComputeSecrets.cs new file mode 100644 index 0000000000000..928dc31c00143 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksComputeSecrets.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Secrets related to a Machine Learning compute based on AKS. + /// + [Newtonsoft.Json.JsonObject("AKS")] + public partial class AksComputeSecrets : ComputeSecrets + { + /// + /// Initializes a new instance of the AksComputeSecrets class. + /// + public AksComputeSecrets() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AksComputeSecrets class. + /// + /// Content of kubeconfig file that can be + /// used to connect to the Kubernetes cluster. + /// Content of kubeconfig file that can + /// be used to connect to the Kubernetes cluster. + /// Image registry pull + /// secret. + public AksComputeSecrets(string userKubeConfig = default(string), string adminKubeConfig = default(string), string imagePullSecretName = default(string)) + { + UserKubeConfig = userKubeConfig; + AdminKubeConfig = adminKubeConfig; + ImagePullSecretName = imagePullSecretName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets content of kubeconfig file that can be used to connect + /// to the Kubernetes cluster. + /// + [JsonProperty(PropertyName = "userKubeConfig")] + public string UserKubeConfig { get; set; } + + /// + /// Gets or sets content of kubeconfig file that can be used to connect + /// to the Kubernetes cluster. + /// + [JsonProperty(PropertyName = "adminKubeConfig")] + public string AdminKubeConfig { get; set; } + + /// + /// Gets or sets image registry pull secret. + /// + [JsonProperty(PropertyName = "imagePullSecretName")] + public string ImagePullSecretName { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksNetworkingConfiguration.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksNetworkingConfiguration.cs new file mode 100644 index 0000000000000..0bf64b74556d8 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksNetworkingConfiguration.cs @@ -0,0 +1,119 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Advance configuration for AKS networking + /// + public partial class AksNetworkingConfiguration + { + /// + /// Initializes a new instance of the AksNetworkingConfiguration class. + /// + public AksNetworkingConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AksNetworkingConfiguration class. + /// + /// Virtual network subnet resource ID the + /// compute nodes belong to + /// A CIDR notation IP range from which to + /// assign service cluster IPs. It must not overlap with any Subnet IP + /// ranges. + /// An IP address assigned to the Kubernetes + /// DNS service. It must be within the Kubernetes service address range + /// specified in serviceCidr. + /// A CIDR notation IP range assigned to + /// the Docker bridge network. It must not overlap with any Subnet IP + /// ranges or the Kubernetes service address range. + public AksNetworkingConfiguration(string subnetId = default(string), string serviceCidr = default(string), string dnsServiceIP = default(string), string dockerBridgeCidr = default(string)) + { + SubnetId = subnetId; + ServiceCidr = serviceCidr; + DnsServiceIP = dnsServiceIP; + DockerBridgeCidr = dockerBridgeCidr; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual network subnet resource ID the compute nodes + /// belong to + /// + [JsonProperty(PropertyName = "subnetId")] + public string SubnetId { get; set; } + + /// + /// Gets or sets a CIDR notation IP range from which to assign service + /// cluster IPs. It must not overlap with any Subnet IP ranges. + /// + [JsonProperty(PropertyName = "serviceCidr")] + public string ServiceCidr { get; set; } + + /// + /// Gets or sets an IP address assigned to the Kubernetes DNS service. + /// It must be within the Kubernetes service address range specified in + /// serviceCidr. + /// + [JsonProperty(PropertyName = "dnsServiceIP")] + public string DnsServiceIP { get; set; } + + /// + /// Gets or sets a CIDR notation IP range assigned to the Docker bridge + /// network. It must not overlap with any Subnet IP ranges or the + /// Kubernetes service address range. + /// + [JsonProperty(PropertyName = "dockerBridgeCidr")] + public string DockerBridgeCidr { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ServiceCidr != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(ServiceCidr, "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$")) + { + throw new ValidationException(ValidationRules.Pattern, "ServiceCidr", "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$"); + } + } + if (DnsServiceIP != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(DnsServiceIP, "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")) + { + throw new ValidationException(ValidationRules.Pattern, "DnsServiceIP", "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"); + } + } + if (DockerBridgeCidr != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(DockerBridgeCidr, "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$")) + { + throw new ValidationException(ValidationRules.Pattern, "DockerBridgeCidr", "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$"); + } + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AllocationState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AllocationState.cs new file mode 100644 index 0000000000000..87578396374d2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AllocationState.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for AllocationState. + /// + public static class AllocationState + { + public const string Steady = "Steady"; + public const string Resizing = "Resizing"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlCompute.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlCompute.cs new file mode 100644 index 0000000000000..f4fd416ccaf61 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlCompute.cs @@ -0,0 +1,86 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Azure Machine Learning compute. + /// + [Newtonsoft.Json.JsonObject("AmlCompute")] + public partial class AmlCompute : Compute + { + /// + /// Initializes a new instance of the AmlCompute class. + /// + public AmlCompute() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmlCompute class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + /// AML Compute properties + public AmlCompute(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), AmlComputeProperties properties = default(AmlComputeProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets AML Compute properties + /// + [JsonProperty(PropertyName = "properties")] + public AmlComputeProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodeInformation.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodeInformation.cs new file mode 100644 index 0000000000000..56dafcdf7fbff --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodeInformation.cs @@ -0,0 +1,112 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Compute node information related to a AmlCompute. + /// + public partial class AmlComputeNodeInformation + { + /// + /// Initializes a new instance of the AmlComputeNodeInformation class. + /// + public AmlComputeNodeInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmlComputeNodeInformation class. + /// + /// Node ID. + /// Private IP address. + /// Public IP address. + /// Port. + /// State of the compute node. Values are idle, + /// running, preparing, unusable, leaving and preempted. Possible + /// values include: 'idle', 'running', 'preparing', 'unusable', + /// 'leaving', 'preempted' + /// Run ID. + public AmlComputeNodeInformation(string nodeId = default(string), string privateIpAddress = default(string), string publicIpAddress = default(string), double? port = default(double?), string nodeState = default(string), string runId = default(string)) + { + NodeId = nodeId; + PrivateIpAddress = privateIpAddress; + PublicIpAddress = publicIpAddress; + Port = port; + NodeState = nodeState; + RunId = runId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets node ID. + /// + /// + /// ID of the compute node. + /// + [JsonProperty(PropertyName = "nodeId")] + public string NodeId { get; private set; } + + /// + /// Gets private IP address. + /// + /// + /// Private IP address of the compute node. + /// + [JsonProperty(PropertyName = "privateIpAddress")] + public string PrivateIpAddress { get; private set; } + + /// + /// Gets public IP address. + /// + /// + /// Public IP address of the compute node. + /// + [JsonProperty(PropertyName = "publicIpAddress")] + public string PublicIpAddress { get; private set; } + + /// + /// Gets port. + /// + /// + /// SSH port number of the node. + /// + [JsonProperty(PropertyName = "port")] + public double? Port { get; private set; } + + /// + /// Gets state of the compute node. Values are idle, running, + /// preparing, unusable, leaving and preempted. Possible values + /// include: 'idle', 'running', 'preparing', 'unusable', 'leaving', + /// 'preempted' + /// + [JsonProperty(PropertyName = "nodeState")] + public string NodeState { get; private set; } + + /// + /// Gets run ID. + /// + /// + /// ID of the Experiment running on the node, if any else null. + /// + [JsonProperty(PropertyName = "runId")] + public string RunId { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodesInformation.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodesInformation.cs new file mode 100644 index 0000000000000..cb871da65c045 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeNodesInformation.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Compute node information related to a AmlCompute. + /// + [Newtonsoft.Json.JsonObject("AmlCompute")] + public partial class AmlComputeNodesInformation : ComputeNodesInformation + { + /// + /// Initializes a new instance of the AmlComputeNodesInformation class. + /// + public AmlComputeNodesInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmlComputeNodesInformation class. + /// + /// The continuation token. + /// The collection of returned AmlCompute nodes + /// details. + public AmlComputeNodesInformation(string nextLink = default(string), IList nodes = default(IList)) + : base(nextLink) + { + Nodes = nodes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the collection of returned AmlCompute nodes details. + /// + [JsonProperty(PropertyName = "nodes")] + public IList Nodes { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeProperties.cs new file mode 100644 index 0000000000000..b4035da498ec2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeProperties.cs @@ -0,0 +1,215 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AML Compute properties + /// + public partial class AmlComputeProperties + { + /// + /// Initializes a new instance of the AmlComputeProperties class. + /// + public AmlComputeProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmlComputeProperties class. + /// + /// Virtual Machine Size + /// Virtual Machine priority. Possible values + /// include: 'Dedicated', 'LowPriority' + /// Scale settings for AML Compute + /// User account + /// credentials. + /// Subnet. + /// Close remote Login Access + /// Port + /// Allocation state. + /// Allocation state + /// transition time. + /// Errors. + /// Current node count. + /// Target node count. + /// Node state counts. + public AmlComputeProperties(string vmSize = default(string), string vmPriority = default(string), ScaleSettings scaleSettings = default(ScaleSettings), UserAccountCredentials userAccountCredentials = default(UserAccountCredentials), ResourceId subnet = default(ResourceId), string remoteLoginPortPublicAccess = default(string), string allocationState = default(string), System.DateTime? allocationStateTransitionTime = default(System.DateTime?), IList errors = default(IList), int? currentNodeCount = default(int?), int? targetNodeCount = default(int?), NodeStateCounts nodeStateCounts = default(NodeStateCounts)) + { + VmSize = vmSize; + VmPriority = vmPriority; + ScaleSettings = scaleSettings; + UserAccountCredentials = userAccountCredentials; + Subnet = subnet; + RemoteLoginPortPublicAccess = remoteLoginPortPublicAccess; + AllocationState = allocationState; + AllocationStateTransitionTime = allocationStateTransitionTime; + Errors = errors; + CurrentNodeCount = currentNodeCount; + TargetNodeCount = targetNodeCount; + NodeStateCounts = nodeStateCounts; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual Machine Size + /// + [JsonProperty(PropertyName = "vmSize")] + public string VmSize { get; set; } + + /// + /// Gets or sets virtual Machine priority. Possible values include: + /// 'Dedicated', 'LowPriority' + /// + [JsonProperty(PropertyName = "vmPriority")] + public string VmPriority { get; set; } + + /// + /// Gets or sets scale settings for AML Compute + /// + [JsonProperty(PropertyName = "scaleSettings")] + public ScaleSettings ScaleSettings { get; set; } + + /// + /// Gets or sets user account credentials. + /// + /// + /// Credentials for an administrator user account that will be created + /// on each compute node. + /// + [JsonProperty(PropertyName = "userAccountCredentials")] + public UserAccountCredentials UserAccountCredentials { get; set; } + + /// + /// Gets or sets subnet. + /// + /// + /// Virtual network subnet resource ID the compute nodes belong to. + /// + [JsonProperty(PropertyName = "subnet")] + public ResourceId Subnet { get; set; } + + /// + /// Gets or sets close remote Login Access Port + /// + /// + /// State of the public SSH port. Possible values are: Disabled - + /// Indicates that the public ssh port is closed on all nodes of the + /// cluster. Enabled - Indicates that the public ssh port is open on + /// all nodes of the cluster. NotSpecified - Indicates that the public + /// ssh port is closed on all nodes of the cluster if VNet is defined, + /// else is open all public nodes. It can be default only during + /// cluster creation time, after creation it will be either enabled or + /// disabled. Possible values include: 'Enabled', 'Disabled', + /// 'NotSpecified' + /// + [JsonProperty(PropertyName = "remoteLoginPortPublicAccess")] + public string RemoteLoginPortPublicAccess { get; set; } + + /// + /// Gets allocation state. + /// + /// + /// Allocation state of the compute. Possible values are: steady - + /// Indicates that the compute is not resizing. There are no changes to + /// the number of compute nodes in the compute in progress. A compute + /// enters this state when it is created and when no operations are + /// being performed on the compute to change the number of compute + /// nodes. resizing - Indicates that the compute is resizing; that is, + /// compute nodes are being added to or removed from the compute. + /// Possible values include: 'Steady', 'Resizing' + /// + [JsonProperty(PropertyName = "allocationState")] + public string AllocationState { get; private set; } + + /// + /// Gets allocation state transition time. + /// + /// + /// The time at which the compute entered its current allocation state. + /// + [JsonProperty(PropertyName = "allocationStateTransitionTime")] + public System.DateTime? AllocationStateTransitionTime { get; private set; } + + /// + /// Gets errors. + /// + /// + /// Collection of errors encountered by various compute nodes during + /// node setup. + /// + [JsonProperty(PropertyName = "errors")] + public IList Errors { get; private set; } + + /// + /// Gets current node count. + /// + /// + /// The number of compute nodes currently assigned to the compute. + /// + [JsonProperty(PropertyName = "currentNodeCount")] + public int? CurrentNodeCount { get; private set; } + + /// + /// Gets target node count. + /// + /// + /// The target number of compute nodes for the compute. If the + /// allocationState is resizing, this property denotes the target node + /// count for the ongoing resize operation. If the allocationState is + /// steady, this property denotes the target node count for the + /// previous resize operation. + /// + [JsonProperty(PropertyName = "targetNodeCount")] + public int? TargetNodeCount { get; private set; } + + /// + /// Gets node state counts. + /// + /// + /// Counts of various node states on the compute. + /// + [JsonProperty(PropertyName = "nodeStateCounts")] + public NodeStateCounts NodeStateCounts { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ScaleSettings != null) + { + ScaleSettings.Validate(); + } + if (UserAccountCredentials != null) + { + UserAccountCredentials.Validate(); + } + if (Subnet != null) + { + Subnet.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlUserFeature.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlUserFeature.cs new file mode 100644 index 0000000000000..e22d752edf7a0 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlUserFeature.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Features enabled for a workspace + /// + public partial class AmlUserFeature + { + /// + /// Initializes a new instance of the AmlUserFeature class. + /// + public AmlUserFeature() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmlUserFeature class. + /// + /// Specifies the feature ID + /// Specifies the feature name + /// Describes the feature for user + /// experience + public AmlUserFeature(string id = default(string), string displayName = default(string), string description = default(string)) + { + Id = id; + DisplayName = displayName; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the feature ID + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets specifies the feature name + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets describes the feature for user experience + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ClusterUpdateParameters.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ClusterUpdateParameters.cs new file mode 100644 index 0000000000000..9087828997a05 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ClusterUpdateParameters.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// AmlCompute update parameters. + /// + [Rest.Serialization.JsonTransformation] + public partial class ClusterUpdateParameters + { + /// + /// Initializes a new instance of the ClusterUpdateParameters class. + /// + public ClusterUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClusterUpdateParameters class. + /// + /// Scale settings. + public ClusterUpdateParameters(ScaleSettings scaleSettings = default(ScaleSettings)) + { + ScaleSettings = scaleSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets scale settings. + /// + /// + /// Desired scale settings for the amlCompute. + /// + [JsonProperty(PropertyName = "properties.scaleSettings")] + public ScaleSettings ScaleSettings { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ScaleSettings != null) + { + ScaleSettings.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Compute.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Compute.cs new file mode 100644 index 0000000000000..a0b3113a16d86 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Compute.cs @@ -0,0 +1,125 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Machine Learning compute object. + /// + [Newtonsoft.Json.JsonObject("Compute")] + public partial class Compute + { + /// + /// Initializes a new instance of the Compute class. + /// + public Compute() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Compute class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + public Compute(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?)) + { + ComputeLocation = computeLocation; + ProvisioningState = provisioningState; + Description = description; + CreatedOn = createdOn; + ModifiedOn = modifiedOn; + ResourceId = resourceId; + ProvisioningErrors = provisioningErrors; + IsAttachedCompute = isAttachedCompute; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets location for the underlying compute + /// + [JsonProperty(PropertyName = "computeLocation")] + public string ComputeLocation { get; set; } + + /// + /// Gets the provision state of the cluster. Valid values are Unknown, + /// Updating, Provisioning, Succeeded, and Failed. Possible values + /// include: 'Unknown', 'Updating', 'Creating', 'Deleting', + /// 'Succeeded', 'Failed', 'Canceled' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the description of the Machine Learning compute. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets the date and time when the compute was created. + /// + [JsonProperty(PropertyName = "createdOn")] + public System.DateTime? CreatedOn { get; private set; } + + /// + /// Gets the date and time when the compute was last modified. + /// + [JsonProperty(PropertyName = "modifiedOn")] + public System.DateTime? ModifiedOn { get; private set; } + + /// + /// Gets or sets ARM resource id of the underlying compute + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets errors during provisioning + /// + [JsonProperty(PropertyName = "provisioningErrors")] + public IList ProvisioningErrors { get; private set; } + + /// + /// Gets indicating whether the compute was provisioned by user and + /// brought from outside if true, or machine learning service + /// provisioned it if false. + /// + [JsonProperty(PropertyName = "isAttachedCompute")] + public bool? IsAttachedCompute { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeNodesInformation.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeNodesInformation.cs new file mode 100644 index 0000000000000..8ec67e7a40204 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeNodesInformation.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Compute nodes information related to a Machine Learning compute. Might + /// differ for every type of compute. + /// + [Newtonsoft.Json.JsonObject("ComputeNodesInformation")] + public partial class ComputeNodesInformation + { + /// + /// Initializes a new instance of the ComputeNodesInformation class. + /// + public ComputeNodesInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeNodesInformation class. + /// + /// The continuation token. + public ComputeNodesInformation(string nextLink = default(string)) + { + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the continuation token. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeResource.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeResource.cs new file mode 100644 index 0000000000000..dfa161a0c39bf --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeResource.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Machine Learning compute object wrapped into ARM resource envelope. + /// + public partial class ComputeResource : Resource + { + /// + /// Initializes a new instance of the ComputeResource class. + /// + public ComputeResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeResource class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + /// Compute properties + public ComputeResource(string id = default(string), string name = default(string), Identity identity = default(Identity), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Compute properties = default(Compute)) + : base(id, name, identity, location, type, tags, sku) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets compute properties + /// + [JsonProperty(PropertyName = "properties")] + public Compute Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeSecrets.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeSecrets.cs new file mode 100644 index 0000000000000..66f33afdaa067 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeSecrets.cs @@ -0,0 +1,38 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Secrets related to a Machine Learning compute. Might differ for every + /// type of compute. + /// + [Newtonsoft.Json.JsonObject("ComputeSecrets")] + public partial class ComputeSecrets + { + /// + /// Initializes a new instance of the ComputeSecrets class. + /// + public ComputeSecrets() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeType.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeType.cs new file mode 100644 index 0000000000000..7cfec717d8e3f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeType.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for ComputeType. + /// + public static class ComputeType + { + public const string AKS = "AKS"; + public const string AmlCompute = "AmlCompute"; + public const string DataFactory = "DataFactory"; + public const string VirtualMachine = "VirtualMachine"; + public const string HDInsight = "HDInsight"; + public const string Databricks = "Databricks"; + public const string DataLakeAnalytics = "DataLakeAnalytics"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataFactory.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataFactory.cs new file mode 100644 index 0000000000000..051e805220ca6 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataFactory.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A DataFactory compute. + /// + [Newtonsoft.Json.JsonObject("DataFactory")] + public partial class DataFactory : Compute + { + /// + /// Initializes a new instance of the DataFactory class. + /// + public DataFactory() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFactory class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + public DataFactory(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalytics.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalytics.cs new file mode 100644 index 0000000000000..d8ccad6c99ee7 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalytics.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A DataLakeAnalytics compute. + /// + [Newtonsoft.Json.JsonObject("DataLakeAnalytics")] + public partial class DataLakeAnalytics : Compute + { + /// + /// Initializes a new instance of the DataLakeAnalytics class. + /// + public DataLakeAnalytics() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataLakeAnalytics class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + public DataLakeAnalytics(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), DataLakeAnalyticsProperties properties = default(DataLakeAnalyticsProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public DataLakeAnalyticsProperties Properties { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalyticsProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalyticsProperties.cs new file mode 100644 index 0000000000000..fa9841e8f2233 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalyticsProperties.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class DataLakeAnalyticsProperties + { + /// + /// Initializes a new instance of the DataLakeAnalyticsProperties + /// class. + /// + public DataLakeAnalyticsProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataLakeAnalyticsProperties + /// class. + /// + /// DataLake Store Account + /// Name + public DataLakeAnalyticsProperties(string dataLakeStoreAccountName = default(string)) + { + DataLakeStoreAccountName = dataLakeStoreAccountName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets dataLake Store Account Name + /// + [JsonProperty(PropertyName = "dataLakeStoreAccountName")] + public string DataLakeStoreAccountName { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Databricks.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Databricks.cs new file mode 100644 index 0000000000000..3e232f2649ff1 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Databricks.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A DataFactory compute. + /// + [Newtonsoft.Json.JsonObject("Databricks")] + public partial class Databricks : Compute + { + /// + /// Initializes a new instance of the Databricks class. + /// + public Databricks() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Databricks class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + public Databricks(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), DatabricksProperties properties = default(DatabricksProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public DatabricksProperties Properties { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksComputeSecrets.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksComputeSecrets.cs new file mode 100644 index 0000000000000..6b859c12da66b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksComputeSecrets.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Secrets related to a Machine Learning compute based on Databricks. + /// + [Newtonsoft.Json.JsonObject("Databricks")] + public partial class DatabricksComputeSecrets : ComputeSecrets + { + /// + /// Initializes a new instance of the DatabricksComputeSecrets class. + /// + public DatabricksComputeSecrets() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DatabricksComputeSecrets class. + /// + /// access token for databricks + /// account. + public DatabricksComputeSecrets(string databricksAccessToken = default(string)) + { + DatabricksAccessToken = databricksAccessToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets access token for databricks account. + /// + [JsonProperty(PropertyName = "databricksAccessToken")] + public string DatabricksAccessToken { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksProperties.cs new file mode 100644 index 0000000000000..85ed6aabf3022 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksProperties.cs @@ -0,0 +1,48 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class DatabricksProperties + { + /// + /// Initializes a new instance of the DatabricksProperties class. + /// + public DatabricksProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DatabricksProperties class. + /// + /// Databricks access token + public DatabricksProperties(string databricksAccessToken = default(string)) + { + DatabricksAccessToken = databricksAccessToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets databricks access token + /// + [JsonProperty(PropertyName = "databricksAccessToken")] + public string DatabricksAccessToken { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionProperty.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionProperty.cs new file mode 100644 index 0000000000000..8fa71945ea0e4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionProperty.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + public partial class EncryptionProperty + { + /// + /// Initializes a new instance of the EncryptionProperty class. + /// + public EncryptionProperty() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EncryptionProperty class. + /// + /// Indicates whether or not the encryption is + /// enabled for the workspace. Possible values include: 'Enabled', + /// 'Disabled' + /// Customer Key vault + /// properties. + public EncryptionProperty(string status, KeyVaultProperties keyVaultProperties) + { + Status = status; + KeyVaultProperties = keyVaultProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates whether or not the encryption is enabled for + /// the workspace. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets customer Key vault properties. + /// + [JsonProperty(PropertyName = "keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Status == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + } + if (KeyVaultProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KeyVaultProperties"); + } + if (KeyVaultProperties != null) + { + KeyVaultProperties.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionStatus.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionStatus.cs new file mode 100644 index 0000000000000..b57375b90fe33 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionStatus.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for EncryptionStatus. + /// + public static class EncryptionStatus + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorDetail.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 0000000000000..2bf9e2ad96357 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error detail information. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// Error code. + /// Error message. + public ErrorDetail(string code, string message) + { + Code = code; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Code == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Code"); + } + if (Message == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Message"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorResponse.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorResponse.cs new file mode 100644 index 0000000000000..5f922bad08780 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorResponse.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Error response information. + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// Error code. + /// Error message. + /// An array of error detail objects. + public ErrorResponse(string code = default(string), string message = default(string), IList details = default(IList)) + { + Code = code; + Message = message; + Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets an array of error detail objects. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorResponseException.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorResponseException.cs new file mode 100644 index 0000000000000..fae7141b6ea31 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/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.MachineLearningServices.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/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsight.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsight.cs new file mode 100644 index 0000000000000..1bdf332079ff4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsight.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A HDInsight compute. + /// + [Newtonsoft.Json.JsonObject("HDInsight")] + public partial class HDInsight : Compute + { + /// + /// Initializes a new instance of the HDInsight class. + /// + public HDInsight() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HDInsight class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + public HDInsight(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), HDInsightProperties properties = default(HDInsightProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public HDInsightProperties Properties { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsightProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsightProperties.cs new file mode 100644 index 0000000000000..a50ec018664e4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsightProperties.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class HDInsightProperties + { + /// + /// Initializes a new instance of the HDInsightProperties class. + /// + public HDInsightProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HDInsightProperties class. + /// + /// Port open for ssh connections on the master + /// node of the cluster. + /// Public IP address of the master node of the + /// cluster. + /// Admin credentials for master + /// node of the cluster + public HDInsightProperties(int? sshPort = default(int?), string address = default(string), VirtualMachineSshCredentials administratorAccount = default(VirtualMachineSshCredentials)) + { + SshPort = sshPort; + Address = address; + AdministratorAccount = administratorAccount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets port open for ssh connections on the master node of + /// the cluster. + /// + [JsonProperty(PropertyName = "sshPort")] + public int? SshPort { get; set; } + + /// + /// Gets or sets public IP address of the master node of the cluster. + /// + [JsonProperty(PropertyName = "address")] + public string Address { get; set; } + + /// + /// Gets or sets admin credentials for master node of the cluster + /// + [JsonProperty(PropertyName = "administratorAccount")] + public VirtualMachineSshCredentials AdministratorAccount { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Identity.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Identity.cs new file mode 100644 index 0000000000000..7daf1f5379cc8 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Identity.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Identity for the resource. + /// + public partial class Identity + { + /// + /// Initializes a new instance of the Identity class. + /// + public Identity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Identity class. + /// + /// The identity type. Possible values include: + /// 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + /// 'None' + /// The principal ID of resource + /// identity. + /// The tenant ID of resource. + /// The list of user identities + /// associated with resource. The user identity dictionary key + /// references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + public Identity(ResourceIdentityType type, string principalId = default(string), string tenantId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + UserAssignedIdentities = userAssignedIdentities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal ID of resource identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the tenant ID of resource. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets the identity type. Possible values include: + /// 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + /// 'None' + /// + [JsonProperty(PropertyName = "type")] + public ResourceIdentityType Type { get; set; } + + /// + /// Gets or sets the list of user identities associated with resource. + /// The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/IdentityUserAssignedIdentitiesValue.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/IdentityUserAssignedIdentitiesValue.cs new file mode 100644 index 0000000000000..f8da932ca9784 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/IdentityUserAssignedIdentitiesValue.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class IdentityUserAssignedIdentitiesValue + { + /// + /// Initializes a new instance of the + /// IdentityUserAssignedIdentitiesValue class. + /// + public IdentityUserAssignedIdentitiesValue() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// IdentityUserAssignedIdentitiesValue class. + /// + /// The principal id of user assigned + /// identity. + /// The client id of user assigned + /// identity. + public IdentityUserAssignedIdentitiesValue(string principalId = default(string), string clientId = default(string)) + { + PrincipalId = principalId; + ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal id of user assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the client id of user assigned identity. + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KeyVaultProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KeyVaultProperties.cs new file mode 100644 index 0000000000000..0ef1e9d452446 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KeyVaultProperties.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + public partial class KeyVaultProperties + { + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + public KeyVaultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + /// The ArmId of the keyVault where the + /// customer owned encryption key is present. + /// Key vault uri to access the encryption + /// key. + /// For future use - The client id of + /// the identity which will be used to access key vault. + public KeyVaultProperties(string keyVaultArmId, string keyIdentifier, string identityClientId = default(string)) + { + KeyVaultArmId = keyVaultArmId; + KeyIdentifier = keyIdentifier; + IdentityClientId = identityClientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ArmId of the keyVault where the customer owned + /// encryption key is present. + /// + [JsonProperty(PropertyName = "keyVaultArmId")] + public string KeyVaultArmId { get; set; } + + /// + /// Gets or sets key vault uri to access the encryption key. + /// + [JsonProperty(PropertyName = "keyIdentifier")] + public string KeyIdentifier { get; set; } + + /// + /// Gets or sets for future use - The client id of the identity which + /// will be used to access key vault. + /// + [JsonProperty(PropertyName = "identityClientId")] + public string IdentityClientId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (KeyVaultArmId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KeyVaultArmId"); + } + if (KeyIdentifier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KeyIdentifier"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListWorkspaceKeysResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListWorkspaceKeysResult.cs new file mode 100644 index 0000000000000..c1198cc4c05ed --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListWorkspaceKeysResult.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ListWorkspaceKeysResult + { + /// + /// Initializes a new instance of the ListWorkspaceKeysResult class. + /// + public ListWorkspaceKeysResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ListWorkspaceKeysResult class. + /// + public ListWorkspaceKeysResult(string userStorageKey = default(string), string userStorageResourceId = default(string), string appInsightsInstrumentationKey = default(string), RegistryListCredentialsResult containerRegistryCredentials = default(RegistryListCredentialsResult)) + { + UserStorageKey = userStorageKey; + UserStorageResourceId = userStorageResourceId; + AppInsightsInstrumentationKey = appInsightsInstrumentationKey; + ContainerRegistryCredentials = containerRegistryCredentials; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "userStorageKey")] + public string UserStorageKey { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "userStorageResourceId")] + public string UserStorageResourceId { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "appInsightsInstrumentationKey")] + public string AppInsightsInstrumentationKey { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "containerRegistryCredentials")] + public RegistryListCredentialsResult ContainerRegistryCredentials { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeCreateOrUpdateHeaders.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..d5a191293e3fe --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeCreateOrUpdateHeaders.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class MachineLearningComputeCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the + /// MachineLearningComputeCreateOrUpdateHeaders class. + /// + public MachineLearningComputeCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MachineLearningComputeCreateOrUpdateHeaders class. + /// + /// URI to poll for asynchronous + /// operation status. + public MachineLearningComputeCreateOrUpdateHeaders(string azureAsyncOperation = default(string)) + { + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URI to poll for asynchronous operation status. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeDeleteHeaders.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeDeleteHeaders.cs new file mode 100644 index 0000000000000..7d6d028eaf106 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningComputeDeleteHeaders.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class MachineLearningComputeDeleteHeaders + { + /// + /// Initializes a new instance of the + /// MachineLearningComputeDeleteHeaders class. + /// + public MachineLearningComputeDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MachineLearningComputeDeleteHeaders class. + /// + /// URI to poll for asynchronous + /// operation status. + /// URI to poll for asynchronous operation + /// result. + public MachineLearningComputeDeleteHeaders(string azureAsyncOperation = default(string), string location = default(string)) + { + AzureAsyncOperation = azureAsyncOperation; + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URI to poll for asynchronous operation status. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + /// + /// Gets or sets URI to poll for asynchronous operation result. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceError.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceError.cs new file mode 100644 index 0000000000000..e0dc46a7232f2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceError.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Wrapper for error response to follow ARM guidelines. + /// + public partial class MachineLearningServiceError + { + /// + /// Initializes a new instance of the MachineLearningServiceError + /// class. + /// + public MachineLearningServiceError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MachineLearningServiceError + /// class. + /// + /// The error response. + public MachineLearningServiceError(ErrorResponse error = default(ErrorResponse)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error response. + /// + [JsonProperty(PropertyName = "error")] + public ErrorResponse Error { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceErrorException.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceErrorException.cs new file mode 100644 index 0000000000000..f7ae1f4119ef9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/MachineLearningServiceErrorException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with + /// MachineLearningServiceError information. + /// + public partial class MachineLearningServiceErrorException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public MachineLearningServiceError Body { get; set; } + + /// + /// Initializes a new instance of the MachineLearningServiceErrorException class. + /// + public MachineLearningServiceErrorException() + { + } + + /// + /// Initializes a new instance of the MachineLearningServiceErrorException class. + /// + /// The exception message. + public MachineLearningServiceErrorException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the MachineLearningServiceErrorException class. + /// + /// The exception message. + /// Inner exception. + public MachineLearningServiceErrorException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeState.cs new file mode 100644 index 0000000000000..0bb7f549ceb5e --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeState.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for NodeState. + /// + public static class NodeState + { + public const string Idle = "idle"; + public const string Running = "running"; + public const string Preparing = "preparing"; + public const string Unusable = "unusable"; + public const string Leaving = "leaving"; + public const string Preempted = "preempted"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeStateCounts.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeStateCounts.cs new file mode 100644 index 0000000000000..20f2be1e29119 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NodeStateCounts.cs @@ -0,0 +1,109 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Counts of various compute node states on the amlCompute. + /// + public partial class NodeStateCounts + { + /// + /// Initializes a new instance of the NodeStateCounts class. + /// + public NodeStateCounts() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NodeStateCounts class. + /// + /// Idle node count. + /// Running node count. + /// Preparing node count. + /// Unusable node count. + /// Leaving node count. + /// Preempted node count. + public NodeStateCounts(int? idleNodeCount = default(int?), int? runningNodeCount = default(int?), int? preparingNodeCount = default(int?), int? unusableNodeCount = default(int?), int? leavingNodeCount = default(int?), int? preemptedNodeCount = default(int?)) + { + IdleNodeCount = idleNodeCount; + RunningNodeCount = runningNodeCount; + PreparingNodeCount = preparingNodeCount; + UnusableNodeCount = unusableNodeCount; + LeavingNodeCount = leavingNodeCount; + PreemptedNodeCount = preemptedNodeCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets idle node count. + /// + /// + /// Number of compute nodes in idle state. + /// + [JsonProperty(PropertyName = "idleNodeCount")] + public int? IdleNodeCount { get; private set; } + + /// + /// Gets running node count. + /// + /// + /// Number of compute nodes which are running jobs. + /// + [JsonProperty(PropertyName = "runningNodeCount")] + public int? RunningNodeCount { get; private set; } + + /// + /// Gets preparing node count. + /// + /// + /// Number of compute nodes which are being prepared. + /// + [JsonProperty(PropertyName = "preparingNodeCount")] + public int? PreparingNodeCount { get; private set; } + + /// + /// Gets unusable node count. + /// + /// + /// Number of compute nodes which are in unusable state. + /// + [JsonProperty(PropertyName = "unusableNodeCount")] + public int? UnusableNodeCount { get; private set; } + + /// + /// Gets leaving node count. + /// + /// + /// Number of compute nodes which are leaving the amlCompute. + /// + [JsonProperty(PropertyName = "leavingNodeCount")] + public int? LeavingNodeCount { get; private set; } + + /// + /// Gets preempted node count. + /// + /// + /// Number of compute nodes which are in preempted state. + /// + [JsonProperty(PropertyName = "preemptedNodeCount")] + public int? PreemptedNodeCount { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Operation.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Operation.cs new file mode 100644 index 0000000000000..de68889311e6e --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Operation.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure Machine Learning workspace REST API operation + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// Operation name: + /// {provider}/{resource}/{operation} + /// Display name of operation + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets operation name: {provider}/{resource}/{operation} + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets display name of operation + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationDisplay.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 0000000000000..c7936af142fc5 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationDisplay.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Display name of operation + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// The resource provider name: + /// Microsoft.MachineLearningExperimentation + /// The resource on which the operation is + /// performed. + /// The operation that users can + /// perform. + /// The description for the + /// operation. + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource provider name: + /// Microsoft.MachineLearningExperimentation + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets the resource on which the operation is performed. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + /// + /// Gets or sets the operation that users can perform. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets the description for the operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page.cs new file mode 100644 index 0000000000000..174590e64d54f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page1.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page1.cs new file mode 100644 index 0000000000000..12e6203f84cff --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page1.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Password.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Password.cs new file mode 100644 index 0000000000000..22b5d7600608b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Password.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class Password + { + /// + /// Initializes a new instance of the Password class. + /// + public Password() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Password class. + /// + public Password(string name = default(string), string value = default(string)) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpoint.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpoint.cs new file mode 100644 index 0000000000000..904c7dc0dfa05 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpoint.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Private Endpoint resource. + /// + public partial class PrivateEndpoint + { + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + public PrivateEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + /// The ARM identifier for Private Endpoint + public PrivateEndpoint(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the ARM identifier for Private Endpoint + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnection.cs new file mode 100644 index 0000000000000..ca30e0c9816eb --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnection.cs @@ -0,0 +1,104 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The Private Endpoint Connection resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateEndpointConnection : Resource + { + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + public PrivateEndpointConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + /// A collection of + /// information about the state of the connection between service + /// consumer and provider. + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + /// The resource of private end + /// point. + /// The provisioning state of the + /// private endpoint connection resource. Possible values include: + /// 'Succeeded', 'Creating', 'Deleting', 'Failed' + public PrivateEndpointConnection(PrivateLinkServiceConnectionState privateLinkServiceConnectionState, string id = default(string), string name = default(string), Identity identity = default(Identity), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), string provisioningState = default(string)) + : base(id, name, identity, location, type, tags, sku) + { + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource of private end point. + /// + [JsonProperty(PropertyName = "properties.privateEndpoint")] + public PrivateEndpoint PrivateEndpoint { get; set; } + + /// + /// Gets or sets a collection of information about the state of the + /// connection between service consumer and provider. + /// + [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + + /// + /// Gets or sets the provisioning state of the private endpoint + /// connection resource. Possible values include: 'Succeeded', + /// 'Creating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (PrivateLinkServiceConnectionState == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PrivateLinkServiceConnectionState"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 0000000000000..e5c43266e2286 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for PrivateEndpointConnectionProvisioningState. + /// + public static class PrivateEndpointConnectionProvisioningState + { + public const string Succeeded = "Succeeded"; + public const string Creating = "Creating"; + public const string Deleting = "Deleting"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 0000000000000..fd8a93df2042c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for PrivateEndpointServiceConnectionStatus. + /// + public static class PrivateEndpointServiceConnectionStatus + { + public const string Pending = "Pending"; + public const string Approved = "Approved"; + public const string Rejected = "Rejected"; + public const string Disconnected = "Disconnected"; + public const string Timeout = "Timeout"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResource.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResource.cs new file mode 100644 index 0000000000000..34967fd37f422 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResource.cs @@ -0,0 +1,94 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A private link resource + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateLinkResource : Resource + { + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + public PrivateLinkResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + /// The private link resource group id. + /// The private link resource required + /// member names. + /// The private link resource Private + /// link DNS zone name. + public PrivateLinkResource(string id = default(string), string name = default(string), Identity identity = default(Identity), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList)) + : base(id, name, identity, location, type, tags, sku) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the private link resource group id. + /// + [JsonProperty(PropertyName = "properties.groupId")] + public string GroupId { get; private set; } + + /// + /// Gets the private link resource required member names. + /// + [JsonProperty(PropertyName = "properties.requiredMembers")] + public IList RequiredMembers { get; private set; } + + /// + /// Gets or sets the private link resource Private link DNS zone name. + /// + [JsonProperty(PropertyName = "properties.requiredZoneNames")] + public IList RequiredZoneNames { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResourceListResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResourceListResult.cs new file mode 100644 index 0000000000000..9070ccc04ea91 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResourceListResult.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A list of private link resources + /// + public partial class PrivateLinkResourceListResult + { + /// + /// Initializes a new instance of the PrivateLinkResourceListResult + /// class. + /// + public PrivateLinkResourceListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResourceListResult + /// class. + /// + /// Array of private link resources + public PrivateLinkResourceListResult(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets array of private link resources + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkServiceConnectionState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkServiceConnectionState.cs new file mode 100644 index 0000000000000..68aac9347c969 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkServiceConnectionState.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A collection of information about the state of the connection between + /// service consumer and provider. + /// + public partial class PrivateLinkServiceConnectionState + { + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + public PrivateLinkServiceConnectionState() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + /// Indicates whether the connection has been + /// Approved/Rejected/Removed by the owner of the service. Possible + /// values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', + /// 'Timeout' + /// The reason for approval/rejection of the + /// connection. + /// A message indicating if changes on + /// the service provider require any updates on the consumer. + public PrivateLinkServiceConnectionState(string status = default(string), string description = default(string), string actionsRequired = default(string)) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates whether the connection has been + /// Approved/Rejected/Removed by the owner of the service. Possible + /// values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', + /// 'Timeout' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the reason for approval/rejection of the connection. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets a message indicating if changes on the service + /// provider require any updates on the consumer. + /// + [JsonProperty(PropertyName = "actionsRequired")] + public string ActionsRequired { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ProvisioningState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 0000000000000..d0cfe37ad21fa --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for ProvisioningState. + /// + public static class ProvisioningState + { + public const string Unknown = "Unknown"; + public const string Updating = "Updating"; + public const string Creating = "Creating"; + public const string Deleting = "Deleting"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Canceled = "Canceled"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaBaseProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaBaseProperties.cs new file mode 100644 index 0000000000000..22c890df34eb5 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaBaseProperties.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties for Quota update or retrieval. + /// + public partial class QuotaBaseProperties + { + /// + /// Initializes a new instance of the QuotaBaseProperties class. + /// + public QuotaBaseProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuotaBaseProperties class. + /// + /// Specifies the resource ID. + /// Specifies the resource type. + /// Limit. + /// An enum describing the unit of quota + /// measurement. Possible values include: 'Count' + public QuotaBaseProperties(string id = default(string), string type = default(string), long? limit = default(long?), string unit = default(string)) + { + Id = id; + Type = type; + Limit = limit; + Unit = unit; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets specifies the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets limit. + /// + /// + /// The maximum permitted quota of the resource. + /// + [JsonProperty(PropertyName = "limit")] + public long? Limit { get; set; } + + /// + /// Gets or sets an enum describing the unit of quota measurement. + /// Possible values include: 'Count' + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUnit.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUnit.cs new file mode 100644 index 0000000000000..12fd5189097f4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUnit.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for QuotaUnit. + /// + public static class QuotaUnit + { + public const string Count = "Count"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUpdateParameters.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUpdateParameters.cs new file mode 100644 index 0000000000000..ca5291df9d677 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUpdateParameters.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Quota update parameters. + /// + public partial class QuotaUpdateParameters + { + /// + /// Initializes a new instance of the QuotaUpdateParameters class. + /// + public QuotaUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuotaUpdateParameters class. + /// + /// The list for update quota. + public QuotaUpdateParameters(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list for update quota. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ReasonCode.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ReasonCode.cs new file mode 100644 index 0000000000000..12544612047b9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ReasonCode.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for ReasonCode. + /// + public static class ReasonCode + { + public const string NotSpecified = "NotSpecified"; + public const string NotAvailableForRegion = "NotAvailableForRegion"; + public const string NotAvailableForSubscription = "NotAvailableForSubscription"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RegistryListCredentialsResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RegistryListCredentialsResult.cs new file mode 100644 index 0000000000000..4295dd1dc5697 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RegistryListCredentialsResult.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class RegistryListCredentialsResult + { + /// + /// Initializes a new instance of the RegistryListCredentialsResult + /// class. + /// + public RegistryListCredentialsResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RegistryListCredentialsResult + /// class. + /// + public RegistryListCredentialsResult(string location = default(string), string username = default(string), IList passwords = default(IList)) + { + Location = location; + Username = username; + Passwords = passwords; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "username")] + public string Username { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "passwords")] + public IList Passwords { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RemoteLoginPortPublicAccess.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RemoteLoginPortPublicAccess.cs new file mode 100644 index 0000000000000..f8ccbd19c2006 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/RemoteLoginPortPublicAccess.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for RemoteLoginPortPublicAccess. + /// + public static class RemoteLoginPortPublicAccess + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + public const string NotSpecified = "NotSpecified"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Resource.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Resource.cs new file mode 100644 index 0000000000000..c2a126d4964c1 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Resource.cs @@ -0,0 +1,118 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure Resource Manager resource envelope. + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + public Resource(string id = default(string), string name = default(string), Identity identity = default(Identity), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku)) + { + Id = id; + Name = name; + Identity = identity; + Location = location; + Type = type; + Tags = tags; + Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets specifies the name of the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets the identity of the resource. + /// + [JsonProperty(PropertyName = "identity")] + public Identity Identity { get; set; } + + /// + /// Gets or sets specifies the location of the resource. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets specifies the type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets contains resource tags defined as key/value pairs. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the sku of the workspace. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Identity != null) + { + Identity.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceId.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceId.cs new file mode 100644 index 0000000000000..05b8f70cd087a --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceId.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a resource ID. For example, for a subnet, it is the resource + /// URL for the subnet. + /// + public partial class ResourceId : IResource + { + /// + /// Initializes a new instance of the ResourceId class. + /// + public ResourceId() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceId class. + /// + /// The ID of the resource + public ResourceId(string id) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ID of the resource + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceIdentityType.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceIdentityType.cs new file mode 100644 index 0000000000000..a0a4ad4a15fb4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceIdentityType.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ResourceIdentityType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ResourceIdentityType + { + [EnumMember(Value = "SystemAssigned")] + SystemAssigned, + [EnumMember(Value = "UserAssigned")] + UserAssigned, + [EnumMember(Value = "SystemAssigned, UserAssigned")] + SystemAssignedUserAssigned, + [EnumMember(Value = "None")] + None + } + internal static class ResourceIdentityTypeEnumExtension + { + internal static string ToSerializedValue(this ResourceIdentityType? value) + { + return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ResourceIdentityType value) + { + switch( value ) + { + case ResourceIdentityType.SystemAssigned: + return "SystemAssigned"; + case ResourceIdentityType.UserAssigned: + return "UserAssigned"; + case ResourceIdentityType.SystemAssignedUserAssigned: + return "SystemAssigned, UserAssigned"; + case ResourceIdentityType.None: + return "None"; + } + return null; + } + + internal static ResourceIdentityType? ParseResourceIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return ResourceIdentityType.SystemAssigned; + case "UserAssigned": + return ResourceIdentityType.UserAssigned; + case "SystemAssigned, UserAssigned": + return ResourceIdentityType.SystemAssignedUserAssigned; + case "None": + return ResourceIdentityType.None; + } + return null; + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceName.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceName.cs new file mode 100644 index 0000000000000..ddf14b962231c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceName.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Resource Name. + /// + public partial class ResourceName + { + /// + /// Initializes a new instance of the ResourceName class. + /// + public ResourceName() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceName class. + /// + /// The name of the resource. + /// The localized name of the + /// resource. + public ResourceName(string value = default(string), string localizedValue = default(string)) + { + Value = value; + LocalizedValue = localizedValue; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the resource. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Gets the localized name of the resource. + /// + [JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceQuota.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceQuota.cs new file mode 100644 index 0000000000000..62a33bab2a5fa --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceQuota.cs @@ -0,0 +1,88 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The quota assigned to a resource. + /// + public partial class ResourceQuota + { + /// + /// Initializes a new instance of the ResourceQuota class. + /// + public ResourceQuota() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceQuota class. + /// + /// Specifies the resource ID. + /// Specifies the resource type. + /// Name of the resource. + /// Limit. + /// An enum describing the unit of quota + /// measurement. Possible values include: 'Count' + public ResourceQuota(string id = default(string), string type = default(string), ResourceName name = default(ResourceName), long? limit = default(long?), string unit = default(string)) + { + Id = id; + Type = type; + Name = name; + Limit = limit; + Unit = unit; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets specifies the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets name of the resource. + /// + [JsonProperty(PropertyName = "name")] + public ResourceName Name { get; private set; } + + /// + /// Gets limit. + /// + /// + /// The maximum permitted quota of the resource. + /// + [JsonProperty(PropertyName = "limit")] + public long? Limit { get; private set; } + + /// + /// Gets an enum describing the unit of quota measurement. Possible + /// values include: 'Count' + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuLocationInfo.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuLocationInfo.cs new file mode 100644 index 0000000000000..6561b786334ea --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuLocationInfo.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class ResourceSkuLocationInfo + { + /// + /// Initializes a new instance of the ResourceSkuLocationInfo class. + /// + public ResourceSkuLocationInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceSkuLocationInfo class. + /// + /// Location of the SKU + /// List of availability zones where the SKU is + /// supported. + /// Details of capabilities available to a + /// SKU in specific zones. + public ResourceSkuLocationInfo(string location = default(string), IList zones = default(IList), IList zoneDetails = default(IList)) + { + Location = location; + Zones = zones; + ZoneDetails = zoneDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets location of the SKU + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets list of availability zones where the SKU is supported. + /// + [JsonProperty(PropertyName = "zones")] + public IList Zones { get; private set; } + + /// + /// Gets details of capabilities available to a SKU in specific zones. + /// + [JsonProperty(PropertyName = "zoneDetails")] + public IList ZoneDetails { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuZoneDetails.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuZoneDetails.cs new file mode 100644 index 0000000000000..ab43f870cc7f8 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceSkuZoneDetails.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes The zonal capabilities of a SKU. + /// + public partial class ResourceSkuZoneDetails + { + /// + /// Initializes a new instance of the ResourceSkuZoneDetails class. + /// + public ResourceSkuZoneDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceSkuZoneDetails class. + /// + /// The set of zones that the SKU is available in + /// with the specified capabilities. + /// A list of capabilities that are + /// available for the SKU in the specified list of zones. + public ResourceSkuZoneDetails(IList name = default(IList), IList capabilities = default(IList)) + { + Name = name; + Capabilities = capabilities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the set of zones that the SKU is available in with the + /// specified capabilities. + /// + [JsonProperty(PropertyName = "name")] + public IList Name { get; private set; } + + /// + /// Gets a list of capabilities that are available for the SKU in the + /// specified list of zones. + /// + [JsonProperty(PropertyName = "capabilities")] + public IList Capabilities { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Restriction.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Restriction.cs new file mode 100644 index 0000000000000..31ae3583e47fa --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Restriction.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The restriction because of which SKU cannot be used. + /// + public partial class Restriction + { + /// + /// Initializes a new instance of the Restriction class. + /// + public Restriction() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Restriction class. + /// + /// The type of restrictions. As of now only + /// possible value for this is location. + /// The value of restrictions. If the restriction + /// type is set to location. This would be different locations where + /// the SKU is restricted. + /// The reason for the restriction. Possible + /// values include: 'NotSpecified', 'NotAvailableForRegion', + /// 'NotAvailableForSubscription' + public Restriction(string type = default(string), IList values = default(IList), string reasonCode = default(string)) + { + Type = type; + Values = values; + ReasonCode = reasonCode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the type of restrictions. As of now only possible value for + /// this is location. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the value of restrictions. If the restriction type is set to + /// location. This would be different locations where the SKU is + /// restricted. + /// + [JsonProperty(PropertyName = "values")] + public IList Values { get; private set; } + + /// + /// Gets or sets the reason for the restriction. Possible values + /// include: 'NotSpecified', 'NotAvailableForRegion', + /// 'NotAvailableForSubscription' + /// + [JsonProperty(PropertyName = "reasonCode")] + public string ReasonCode { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SKUCapability.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SKUCapability.cs new file mode 100644 index 0000000000000..2a70b2cd017a2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SKUCapability.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Features/user capabilities associated with the sku + /// + public partial class SKUCapability + { + /// + /// Initializes a new instance of the SKUCapability class. + /// + public SKUCapability() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SKUCapability class. + /// + /// Capability/Feature ID + /// Details about the feature/capability + public SKUCapability(string name = default(string), string value = default(string)) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets capability/Feature ID + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets details about the feature/capability + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScaleSettings.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScaleSettings.cs new file mode 100644 index 0000000000000..b17e0adad4cce --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScaleSettings.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// scale settings for AML Compute + /// + public partial class ScaleSettings + { + /// + /// Initializes a new instance of the ScaleSettings class. + /// + public ScaleSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScaleSettings class. + /// + /// Max number of nodes to use + /// Min number of nodes to use + /// Node Idle Time before + /// scaling down amlCompute + public ScaleSettings(int maxNodeCount, int? minNodeCount = default(int?), System.TimeSpan? nodeIdleTimeBeforeScaleDown = default(System.TimeSpan?)) + { + MaxNodeCount = maxNodeCount; + MinNodeCount = minNodeCount; + NodeIdleTimeBeforeScaleDown = nodeIdleTimeBeforeScaleDown; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets max number of nodes to use + /// + [JsonProperty(PropertyName = "maxNodeCount")] + public int MaxNodeCount { get; set; } + + /// + /// Gets or sets min number of nodes to use + /// + [JsonProperty(PropertyName = "minNodeCount")] + public int? MinNodeCount { get; set; } + + /// + /// Gets or sets node Idle Time before scaling down amlCompute + /// + [JsonProperty(PropertyName = "nodeIdleTimeBeforeScaleDown")] + public System.TimeSpan? NodeIdleTimeBeforeScaleDown { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ServicePrincipalCredentials.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ServicePrincipalCredentials.cs new file mode 100644 index 0000000000000..94943dd5d243a --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ServicePrincipalCredentials.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Service principal credentials. + /// + public partial class ServicePrincipalCredentials + { + /// + /// Initializes a new instance of the ServicePrincipalCredentials + /// class. + /// + public ServicePrincipalCredentials() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServicePrincipalCredentials + /// class. + /// + /// Client Id + /// Client secret + public ServicePrincipalCredentials(string clientId, string clientSecret) + { + ClientId = clientId; + ClientSecret = clientSecret; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets client Id + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; set; } + + /// + /// Gets or sets client secret + /// + [JsonProperty(PropertyName = "clientSecret")] + public string ClientSecret { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ClientId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ClientId"); + } + if (ClientSecret == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ClientSecret"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SharedPrivateLinkResource.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SharedPrivateLinkResource.cs new file mode 100644 index 0000000000000..de547121006f9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SharedPrivateLinkResource.cs @@ -0,0 +1,90 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] + public partial class SharedPrivateLinkResource + { + /// + /// Initializes a new instance of the SharedPrivateLinkResource class. + /// + public SharedPrivateLinkResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedPrivateLinkResource class. + /// + /// Unique name of the private link. + /// The resource id that private + /// link links to. + /// The private link resource group id. + /// Request message. + /// Indicates whether the connection has been + /// Approved/Rejected/Removed by the owner of the service. Possible + /// values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', + /// 'Timeout' + public SharedPrivateLinkResource(string name = default(string), string privateLinkResourceId = default(string), string groupId = default(string), string requestMessage = default(string), string status = default(string)) + { + Name = name; + PrivateLinkResourceId = privateLinkResourceId; + GroupId = groupId; + RequestMessage = requestMessage; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unique name of the private link. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the resource id that private link links to. + /// + [JsonProperty(PropertyName = "properties.privateLinkResourceId")] + public string PrivateLinkResourceId { get; set; } + + /// + /// Gets or sets the private link resource group id. + /// + [JsonProperty(PropertyName = "properties.groupId")] + public string GroupId { get; set; } + + /// + /// Gets or sets request message. + /// + [JsonProperty(PropertyName = "properties.requestMessage")] + public string RequestMessage { get; set; } + + /// + /// Gets or sets indicates whether the connection has been + /// Approved/Rejected/Removed by the owner of the service. Possible + /// values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', + /// 'Timeout' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Sku.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Sku.cs new file mode 100644 index 0000000000000..24aa1c1752094 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Sku.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Sku of the resource + /// + public partial class Sku + { + /// + /// Initializes a new instance of the Sku class. + /// + public Sku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Sku class. + /// + /// Name of the sku + /// Tier of the sku like Basic or Enterprise + public Sku(string name = default(string), string tier = default(string)) + { + Name = name; + Tier = tier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the sku + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets tier of the sku like Basic or Enterprise + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SslConfiguration.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SslConfiguration.cs new file mode 100644 index 0000000000000..13cffc845b353 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SslConfiguration.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The ssl configuration for scoring + /// + public partial class SslConfiguration + { + /// + /// Initializes a new instance of the SslConfiguration class. + /// + public SslConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SslConfiguration class. + /// + /// Enable or disable ssl for scoring. Possible + /// values include: 'Disabled', 'Enabled' + /// Cert data + /// Key data + /// CNAME of the cert + public SslConfiguration(string status = default(string), string cert = default(string), string key = default(string), string cname = default(string)) + { + Status = status; + Cert = cert; + Key = key; + Cname = cname; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets enable or disable ssl for scoring. Possible values + /// include: 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets cert data + /// + [JsonProperty(PropertyName = "cert")] + public string Cert { get; set; } + + /// + /// Gets or sets key data + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; set; } + + /// + /// Gets or sets CNAME of the cert + /// + [JsonProperty(PropertyName = "cname")] + public string Cname { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Status.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Status.cs new file mode 100644 index 0000000000000..11bbc3f1f1e29 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Status.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for Status. + /// + public static class Status + { + public const string Undefined = "Undefined"; + public const string Success = "Success"; + public const string Failure = "Failure"; + public const string InvalidQuotaBelowClusterMinimum = "InvalidQuotaBelowClusterMinimum"; + public const string InvalidQuotaExceedsSubscriptionLimit = "InvalidQuotaExceedsSubscriptionLimit"; + public const string InvalidVMFamilyName = "InvalidVMFamilyName"; + public const string OperationNotSupportedForSku = "OperationNotSupportedForSku"; + public const string OperationNotEnabledForRegion = "OperationNotEnabledForRegion"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SystemService.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SystemService.cs new file mode 100644 index 0000000000000..36098f27a5a07 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SystemService.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A system service running on a compute. + /// + public partial class SystemService + { + /// + /// Initializes a new instance of the SystemService class. + /// + public SystemService() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemService class. + /// + /// The type of this system + /// service. + /// Public IP address + /// The version for this type. + public SystemService(string systemServiceType = default(string), string publicIpAddress = default(string), string version = default(string)) + { + SystemServiceType = systemServiceType; + PublicIpAddress = publicIpAddress; + Version = version; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the type of this system service. + /// + [JsonProperty(PropertyName = "systemServiceType")] + public string SystemServiceType { get; private set; } + + /// + /// Gets public IP address + /// + [JsonProperty(PropertyName = "publicIpAddress")] + public string PublicIpAddress { get; private set; } + + /// + /// Gets the version for this type. + /// + [JsonProperty(PropertyName = "version")] + public string Version { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UnderlyingResourceAction.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UnderlyingResourceAction.cs new file mode 100644 index 0000000000000..a5a9773cfe21d --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UnderlyingResourceAction.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for UnderlyingResourceAction. + /// + public static class UnderlyingResourceAction + { + public const string Delete = "Delete"; + public const string Detach = "Detach"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotas.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotas.cs new file mode 100644 index 0000000000000..dfbed6af6800c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotas.cs @@ -0,0 +1,95 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties for update Quota response. + /// + public partial class UpdateWorkspaceQuotas + { + /// + /// Initializes a new instance of the UpdateWorkspaceQuotas class. + /// + public UpdateWorkspaceQuotas() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpdateWorkspaceQuotas class. + /// + /// Specifies the resource ID. + /// Specifies the resource type. + /// Limit. + /// An enum describing the unit of quota + /// measurement. Possible values include: 'Count' + /// Update Workspace Quota Status. + public UpdateWorkspaceQuotas(string id = default(string), string type = default(string), long? limit = default(long?), string unit = default(string), string status = default(string)) + { + Id = id; + Type = type; + Limit = limit; + Unit = unit; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets specifies the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets limit. + /// + /// + /// The maximum permitted quota of the resource. + /// + [JsonProperty(PropertyName = "limit")] + public long? Limit { get; set; } + + /// + /// Gets an enum describing the unit of quota measurement. Possible + /// values include: 'Count' + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; private set; } + + /// + /// Gets or sets update Workspace Quota Status. + /// + /// + /// Status of update workspace quota. Possible values include: + /// 'Undefined', 'Success', 'Failure', + /// 'InvalidQuotaBelowClusterMinimum', + /// 'InvalidQuotaExceedsSubscriptionLimit', 'InvalidVMFamilyName', + /// 'OperationNotSupportedForSku', 'OperationNotEnabledForRegion' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotasResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotasResult.cs new file mode 100644 index 0000000000000..8f98ce6534008 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UpdateWorkspaceQuotasResult.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The result of update workspace quota. + /// + public partial class UpdateWorkspaceQuotasResult + { + /// + /// Initializes a new instance of the UpdateWorkspaceQuotasResult + /// class. + /// + public UpdateWorkspaceQuotasResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpdateWorkspaceQuotasResult + /// class. + /// + /// The list of workspace quota update + /// result. + /// The URI to fetch the next page of workspace + /// quota update result. Call ListNext() with this to fetch the next + /// page of Workspace Quota update result. + public UpdateWorkspaceQuotasResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the list of workspace quota update result. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } + + /// + /// Gets the URI to fetch the next page of workspace quota update + /// result. Call ListNext() with this to fetch the next page of + /// Workspace Quota update result. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Usage.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Usage.cs new file mode 100644 index 0000000000000..ebc2a6ae74580 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Usage.cs @@ -0,0 +1,95 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes AML Resource Usage. + /// + public partial class Usage + { + /// + /// Initializes a new instance of the Usage class. + /// + public Usage() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Usage class. + /// + /// Specifies the resource ID. + /// Specifies the resource type. + /// An enum describing the unit of usage + /// measurement. Possible values include: 'Count' + /// The current usage of the + /// resource. + /// The maximum permitted usage of the + /// resource. + /// The name of the type of usage. + public Usage(string id = default(string), string type = default(string), string unit = default(string), long? currentValue = default(long?), long? limit = default(long?), UsageName name = default(UsageName)) + { + Id = id; + Type = type; + Unit = unit; + CurrentValue = currentValue; + Limit = limit; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets specifies the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets an enum describing the unit of usage measurement. Possible + /// values include: 'Count' + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; private set; } + + /// + /// Gets the current usage of the resource. + /// + [JsonProperty(PropertyName = "currentValue")] + public long? CurrentValue { get; private set; } + + /// + /// Gets the maximum permitted usage of the resource. + /// + [JsonProperty(PropertyName = "limit")] + public long? Limit { get; private set; } + + /// + /// Gets the name of the type of usage. + /// + [JsonProperty(PropertyName = "name")] + public UsageName Name { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageName.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageName.cs new file mode 100644 index 0000000000000..644d7026acde7 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageName.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Usage Names. + /// + public partial class UsageName + { + /// + /// Initializes a new instance of the UsageName class. + /// + public UsageName() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UsageName class. + /// + /// The name of the resource. + /// The localized name of the + /// resource. + public UsageName(string value = default(string), string localizedValue = default(string)) + { + Value = value; + LocalizedValue = localizedValue; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the resource. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Gets the localized name of the resource. + /// + [JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageUnit.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageUnit.cs new file mode 100644 index 0000000000000..fc4844f9e9442 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UsageUnit.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for UsageUnit. + /// + public static class UsageUnit + { + public const string Count = "Count"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UserAccountCredentials.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UserAccountCredentials.cs new file mode 100644 index 0000000000000..40bd590944839 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UserAccountCredentials.cs @@ -0,0 +1,92 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Settings for user account that gets created on each on the nodes of a + /// compute. + /// + public partial class UserAccountCredentials + { + /// + /// Initializes a new instance of the UserAccountCredentials class. + /// + public UserAccountCredentials() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserAccountCredentials class. + /// + /// User name. + /// SSH public key. + /// Password. + public UserAccountCredentials(string adminUserName, string adminUserSshPublicKey = default(string), string adminUserPassword = default(string)) + { + AdminUserName = adminUserName; + AdminUserSshPublicKey = adminUserSshPublicKey; + AdminUserPassword = adminUserPassword; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets user name. + /// + /// + /// Name of the administrator user account which can be used to SSH to + /// nodes. + /// + [JsonProperty(PropertyName = "adminUserName")] + public string AdminUserName { get; set; } + + /// + /// Gets or sets SSH public key. + /// + /// + /// SSH public key of the administrator user account. + /// + [JsonProperty(PropertyName = "adminUserSshPublicKey")] + public string AdminUserSshPublicKey { get; set; } + + /// + /// Gets or sets password. + /// + /// + /// Password of the administrator user account. + /// + [JsonProperty(PropertyName = "adminUserPassword")] + public string AdminUserPassword { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AdminUserName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AdminUserName"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachine.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachine.cs new file mode 100644 index 0000000000000..c23d81a3b7e76 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachine.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A Machine Learning compute based on Azure Virtual Machines. + /// + [Newtonsoft.Json.JsonObject("VirtualMachine")] + public partial class VirtualMachine : Compute + { + /// + /// Initializes a new instance of the VirtualMachine class. + /// + public VirtualMachine() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachine class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The date and time when the compute was + /// created. + /// The date and time when the compute was + /// last modified. + /// ARM resource id of the underlying + /// compute + /// Errors during provisioning + /// Indicating whether the compute was + /// provisioned by user and brought from outside if true, or machine + /// learning service provisioned it if false. + public VirtualMachine(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), VirtualMachineProperties properties = default(VirtualMachineProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public VirtualMachineProperties Properties { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineProperties.cs new file mode 100644 index 0000000000000..1114df6ff66f2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineProperties.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class VirtualMachineProperties + { + /// + /// Initializes a new instance of the VirtualMachineProperties class. + /// + public VirtualMachineProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineProperties class. + /// + /// Virtual Machine size + /// Port open for ssh connections. + /// Public IP address of the virtual + /// machine. + /// Admin credentials for virtual + /// machine + public VirtualMachineProperties(string virtualMachineSize = default(string), int? sshPort = default(int?), string address = default(string), VirtualMachineSshCredentials administratorAccount = default(VirtualMachineSshCredentials)) + { + VirtualMachineSize = virtualMachineSize; + SshPort = sshPort; + Address = address; + AdministratorAccount = administratorAccount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual Machine size + /// + [JsonProperty(PropertyName = "virtualMachineSize")] + public string VirtualMachineSize { get; set; } + + /// + /// Gets or sets port open for ssh connections. + /// + [JsonProperty(PropertyName = "sshPort")] + public int? SshPort { get; set; } + + /// + /// Gets or sets public IP address of the virtual machine. + /// + [JsonProperty(PropertyName = "address")] + public string Address { get; set; } + + /// + /// Gets or sets admin credentials for virtual machine + /// + [JsonProperty(PropertyName = "administratorAccount")] + public VirtualMachineSshCredentials AdministratorAccount { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSecrets.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSecrets.cs new file mode 100644 index 0000000000000..07c927a68ccc2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSecrets.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Secrets related to a Machine Learning compute based on AKS. + /// + [Newtonsoft.Json.JsonObject("VirtualMachine")] + public partial class VirtualMachineSecrets : ComputeSecrets + { + /// + /// Initializes a new instance of the VirtualMachineSecrets class. + /// + public VirtualMachineSecrets() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineSecrets class. + /// + /// Admin credentials for virtual + /// machine. + public VirtualMachineSecrets(VirtualMachineSshCredentials administratorAccount = default(VirtualMachineSshCredentials)) + { + AdministratorAccount = administratorAccount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets admin credentials for virtual machine. + /// + [JsonProperty(PropertyName = "administratorAccount")] + public VirtualMachineSshCredentials AdministratorAccount { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSize.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSize.cs new file mode 100644 index 0000000000000..7b5e0ab72b0fc --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSize.cs @@ -0,0 +1,143 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the properties of a VM size. + /// + public partial class VirtualMachineSize + { + /// + /// Initializes a new instance of the VirtualMachineSize class. + /// + public VirtualMachineSize() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineSize class. + /// + /// Virtual Machine size name + /// Virtual Machine family name + /// Number of vPUs + /// Number of gPUs + /// OS VHD Disk size + /// Resource volume size + /// Memory size + /// Low priority capable + /// Premium IO supported + public VirtualMachineSize(string name = default(string), string family = default(string), int? vCPUs = default(int?), int? gpus = default(int?), int? osVhdSizeMB = default(int?), int? maxResourceVolumeMB = default(int?), double? memoryGB = default(double?), bool? lowPriorityCapable = default(bool?), bool? premiumIO = default(bool?)) + { + Name = name; + Family = family; + VCPUs = vCPUs; + Gpus = gpus; + OsVhdSizeMB = osVhdSizeMB; + MaxResourceVolumeMB = maxResourceVolumeMB; + MemoryGB = memoryGB; + LowPriorityCapable = lowPriorityCapable; + PremiumIO = premiumIO; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets virtual Machine size name + /// + /// + /// The name of the virtual machine size. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets virtual Machine family name + /// + /// + /// The family name of the virtual machine size. + /// + [JsonProperty(PropertyName = "family")] + public string Family { get; private set; } + + /// + /// Gets number of vPUs + /// + /// + /// The number of vCPUs supported by the virtual machine size. + /// + [JsonProperty(PropertyName = "vCPUs")] + public int? VCPUs { get; private set; } + + /// + /// Gets number of gPUs + /// + /// + /// The number of gPUs supported by the virtual machine size. + /// + [JsonProperty(PropertyName = "gpus")] + public int? Gpus { get; private set; } + + /// + /// Gets OS VHD Disk size + /// + /// + /// The OS VHD disk size, in MB, allowed by the virtual machine size. + /// + [JsonProperty(PropertyName = "osVhdSizeMB")] + public int? OsVhdSizeMB { get; private set; } + + /// + /// Gets resource volume size + /// + /// + /// The resource volume size, in MB, allowed by the virtual machine + /// size. + /// + [JsonProperty(PropertyName = "maxResourceVolumeMB")] + public int? MaxResourceVolumeMB { get; private set; } + + /// + /// Gets memory size + /// + /// + /// The amount of memory, in GB, supported by the virtual machine size. + /// + [JsonProperty(PropertyName = "memoryGB")] + public double? MemoryGB { get; private set; } + + /// + /// Gets low priority capable + /// + /// + /// Specifies if the virtual machine size supports low priority VMs. + /// + [JsonProperty(PropertyName = "lowPriorityCapable")] + public bool? LowPriorityCapable { get; private set; } + + /// + /// Gets premium IO supported + /// + /// + /// Specifies if the virtual machine size supports premium IO. + /// + [JsonProperty(PropertyName = "premiumIO")] + public bool? PremiumIO { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSizeListResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSizeListResult.cs new file mode 100644 index 0000000000000..ceb2b080c64f3 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSizeListResult.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The List Virtual Machine size operation response. + /// + public partial class VirtualMachineSizeListResult + { + /// + /// Initializes a new instance of the VirtualMachineSizeListResult + /// class. + /// + public VirtualMachineSizeListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineSizeListResult + /// class. + /// + /// The list of virtual machine sizes + /// supported by AmlCompute. + public VirtualMachineSizeListResult(IList amlCompute = default(IList)) + { + AmlCompute = amlCompute; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of virtual machine sizes supported by + /// AmlCompute. + /// + [JsonProperty(PropertyName = "amlCompute")] + public IList AmlCompute { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSshCredentials.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSshCredentials.cs new file mode 100644 index 0000000000000..d0265f84753cd --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSshCredentials.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Admin credentials for virtual machine + /// + public partial class VirtualMachineSshCredentials + { + /// + /// Initializes a new instance of the VirtualMachineSshCredentials + /// class. + /// + public VirtualMachineSshCredentials() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineSshCredentials + /// class. + /// + /// Username of admin account + /// Password of admin account + /// Public key data + /// Private key data + public VirtualMachineSshCredentials(string username = default(string), string password = default(string), string publicKeyData = default(string), string privateKeyData = default(string)) + { + Username = username; + Password = password; + PublicKeyData = publicKeyData; + PrivateKeyData = privateKeyData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets username of admin account + /// + [JsonProperty(PropertyName = "username")] + public string Username { get; set; } + + /// + /// Gets or sets password of admin account + /// + [JsonProperty(PropertyName = "password")] + public string Password { get; set; } + + /// + /// Gets or sets public key data + /// + [JsonProperty(PropertyName = "publicKeyData")] + public string PublicKeyData { get; set; } + + /// + /// Gets or sets private key data + /// + [JsonProperty(PropertyName = "privateKeyData")] + public string PrivateKeyData { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VmPriority.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VmPriority.cs new file mode 100644 index 0000000000000..699eace389264 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VmPriority.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for VmPriority. + /// + public static class VmPriority + { + public const string Dedicated = "Dedicated"; + public const string LowPriority = "LowPriority"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Workspace.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Workspace.cs new file mode 100644 index 0000000000000..01e8eefcc903e --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Workspace.cs @@ -0,0 +1,272 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An object that represents a machine learning workspace. + /// + [Rest.Serialization.JsonTransformation] + public partial class Workspace : Resource + { + /// + /// Initializes a new instance of the Workspace class. + /// + public Workspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Workspace class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + /// The immutable id associated with this + /// workspace. + /// The description of this + /// workspace. + /// The friendly name for this workspace. + /// This name in mutable + /// The creation time of the machine + /// learning workspace in ISO8601 format. + /// ARM id of the key vault associated with this + /// workspace. This cannot be changed once the workspace has been + /// created + /// ARM id of the application + /// insights associated with this workspace. This cannot be changed + /// once the workspace has been created + /// ARM id of the container registry + /// associated with this workspace. This cannot be changed once the + /// workspace has been created + /// ARM id of the storage account + /// associated with this workspace. This cannot be changed once the + /// workspace has been created + /// Url for the discovery service to + /// identify regional endpoints for machine learning experimentation + /// services + /// The current deployment state of + /// workspace resource. The provisioningState is to indicate states for + /// resource provisioning. Possible values include: 'Unknown', + /// 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', + /// 'Canceled' + /// The encryption settings of Azure ML + /// workspace. + /// The flag to signal HBI data in the + /// workspace and reduce diagnostic data collected by the + /// service + /// The name of the + /// managed resource group created by workspace RP in customer + /// subscription if the workspace is CMK workspace + /// Count of private connections in the + /// workspace + /// The compute name for image + /// build + /// The flag to indicate + /// whether to allow public access when behind VNet. + /// The list of private + /// endpoint connections in the workspace. + /// The list of shared private + /// link resources in this workspace. + public Workspace(string id = default(string), string name = default(string), Identity identity = default(Identity), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string workspaceId = default(string), string description = default(string), string friendlyName = default(string), System.DateTime? creationTime = default(System.DateTime?), string keyVault = default(string), string applicationInsights = default(string), string containerRegistry = default(string), string storageAccount = default(string), string discoveryUrl = default(string), string provisioningState = default(string), EncryptionProperty encryption = default(EncryptionProperty), bool? hbiWorkspace = default(bool?), string serviceProvisionedResourceGroup = default(string), int? privateLinkCount = default(int?), string imageBuildCompute = default(string), bool? allowPublicAccessWhenBehindVnet = default(bool?), IList privateEndpointConnections = default(IList), IList sharedPrivateLinkResources = default(IList)) + : base(id, name, identity, location, type, tags, sku) + { + WorkspaceId = workspaceId; + Description = description; + FriendlyName = friendlyName; + CreationTime = creationTime; + KeyVault = keyVault; + ApplicationInsights = applicationInsights; + ContainerRegistry = containerRegistry; + StorageAccount = storageAccount; + DiscoveryUrl = discoveryUrl; + ProvisioningState = provisioningState; + Encryption = encryption; + HbiWorkspace = hbiWorkspace; + ServiceProvisionedResourceGroup = serviceProvisionedResourceGroup; + PrivateLinkCount = privateLinkCount; + ImageBuildCompute = imageBuildCompute; + AllowPublicAccessWhenBehindVnet = allowPublicAccessWhenBehindVnet; + PrivateEndpointConnections = privateEndpointConnections; + SharedPrivateLinkResources = sharedPrivateLinkResources; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the immutable id associated with this workspace. + /// + [JsonProperty(PropertyName = "properties.workspaceId")] + public string WorkspaceId { get; private set; } + + /// + /// Gets or sets the description of this workspace. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets the friendly name for this workspace. This name in + /// mutable + /// + [JsonProperty(PropertyName = "properties.friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets the creation time of the machine learning workspace in ISO8601 + /// format. + /// + [JsonProperty(PropertyName = "properties.creationTime")] + public System.DateTime? CreationTime { get; private set; } + + /// + /// Gets or sets ARM id of the key vault associated with this + /// workspace. This cannot be changed once the workspace has been + /// created + /// + [JsonProperty(PropertyName = "properties.keyVault")] + public string KeyVault { get; set; } + + /// + /// Gets or sets ARM id of the application insights associated with + /// this workspace. This cannot be changed once the workspace has been + /// created + /// + [JsonProperty(PropertyName = "properties.applicationInsights")] + public string ApplicationInsights { get; set; } + + /// + /// Gets or sets ARM id of the container registry associated with this + /// workspace. This cannot be changed once the workspace has been + /// created + /// + [JsonProperty(PropertyName = "properties.containerRegistry")] + public string ContainerRegistry { get; set; } + + /// + /// Gets or sets ARM id of the storage account associated with this + /// workspace. This cannot be changed once the workspace has been + /// created + /// + [JsonProperty(PropertyName = "properties.storageAccount")] + public string StorageAccount { get; set; } + + /// + /// Gets or sets url for the discovery service to identify regional + /// endpoints for machine learning experimentation services + /// + [JsonProperty(PropertyName = "properties.discoveryUrl")] + public string DiscoveryUrl { get; set; } + + /// + /// Gets the current deployment state of workspace resource. The + /// provisioningState is to indicate states for resource provisioning. + /// Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the encryption settings of Azure ML workspace. + /// + [JsonProperty(PropertyName = "properties.encryption")] + public EncryptionProperty Encryption { get; set; } + + /// + /// Gets or sets the flag to signal HBI data in the workspace and + /// reduce diagnostic data collected by the service + /// + [JsonProperty(PropertyName = "properties.hbiWorkspace")] + public bool? HbiWorkspace { get; set; } + + /// + /// Gets the name of the managed resource group created by workspace RP + /// in customer subscription if the workspace is CMK workspace + /// + [JsonProperty(PropertyName = "properties.serviceProvisionedResourceGroup")] + public string ServiceProvisionedResourceGroup { get; private set; } + + /// + /// Gets count of private connections in the workspace + /// + [JsonProperty(PropertyName = "properties.privateLinkCount")] + public int? PrivateLinkCount { get; private set; } + + /// + /// Gets or sets the compute name for image build + /// + [JsonProperty(PropertyName = "properties.imageBuildCompute")] + public string ImageBuildCompute { get; set; } + + /// + /// Gets or sets the flag to indicate whether to allow public access + /// when behind VNet. + /// + [JsonProperty(PropertyName = "properties.allowPublicAccessWhenBehindVnet")] + public bool? AllowPublicAccessWhenBehindVnet { get; set; } + + /// + /// Gets the list of private endpoint connections in the workspace. + /// + [JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public IList PrivateEndpointConnections { get; private set; } + + /// + /// Gets or sets the list of shared private link resources in this + /// workspace. + /// + [JsonProperty(PropertyName = "properties.sharedPrivateLinkResources")] + public IList SharedPrivateLinkResources { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Encryption != null) + { + Encryption.Validate(); + } + if (PrivateEndpointConnections != null) + { + foreach (var element in PrivateEndpointConnections) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceSku.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceSku.cs new file mode 100644 index 0000000000000..6969e7d07cf2c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceSku.cs @@ -0,0 +1,106 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes Workspace Sku details and features + /// + public partial class WorkspaceSku + { + /// + /// Initializes a new instance of the WorkspaceSku class. + /// + public WorkspaceSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceSku class. + /// + /// The set of locations that the SKU is + /// available. This will be supported and registered Azure Geo Regions + /// (e.g. West US, East US, Southeast Asia, etc.). + /// A list of locations and availability + /// zones in those locations where the SKU is available. + /// Sku Tier like Basic or Enterprise + /// List of features/user capabilities + /// associated with the sku + /// The restrictions because of which SKU + /// cannot be used. This is empty if there are no restrictions. + public WorkspaceSku(IList locations = default(IList), IList locationInfo = default(IList), string tier = default(string), string resourceType = default(string), string name = default(string), IList capabilities = default(IList), IList restrictions = default(IList)) + { + Locations = locations; + LocationInfo = locationInfo; + Tier = tier; + ResourceType = resourceType; + Name = name; + Capabilities = capabilities; + Restrictions = restrictions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the set of locations that the SKU is available. This will be + /// supported and registered Azure Geo Regions (e.g. West US, East US, + /// Southeast Asia, etc.). + /// + [JsonProperty(PropertyName = "locations")] + public IList Locations { get; private set; } + + /// + /// Gets a list of locations and availability zones in those locations + /// where the SKU is available. + /// + [JsonProperty(PropertyName = "locationInfo")] + public IList LocationInfo { get; private set; } + + /// + /// Gets sku Tier like Basic or Enterprise + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets list of features/user capabilities associated with the sku + /// + [JsonProperty(PropertyName = "capabilities")] + public IList Capabilities { get; private set; } + + /// + /// Gets or sets the restrictions because of which SKU cannot be used. + /// This is empty if there are no restrictions. + /// + [JsonProperty(PropertyName = "restrictions")] + public IList Restrictions { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceUpdateParameters.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceUpdateParameters.cs new file mode 100644 index 0000000000000..e2dbf7444adbd --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceUpdateParameters.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The parameters for updating a machine learning workspace. + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkspaceUpdateParameters + { + /// + /// Initializes a new instance of the WorkspaceUpdateParameters class. + /// + public WorkspaceUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceUpdateParameters class. + /// + /// The resource tags for the machine learning + /// workspace. + /// The sku of the workspace. + /// The description of this + /// workspace. + /// The friendly name for this + /// workspace. + public WorkspaceUpdateParameters(IDictionary tags = default(IDictionary), Sku sku = default(Sku), string description = default(string), string friendlyName = default(string)) + { + Tags = tags; + Sku = sku; + Description = description; + FriendlyName = friendlyName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource tags for the machine learning workspace. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the sku of the workspace. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + + /// + /// Gets or sets the description of this workspace. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets the friendly name for this workspace. + /// + [JsonProperty(PropertyName = "properties.friendlyName")] + public string FriendlyName { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Operations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Operations.cs new file mode 100644 index 0000000000000..c11e6555fda2b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Operations.cs @@ -0,0 +1,223 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Lists all of the available Azure Machine Learning Workspaces REST API + /// operations. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.MachineLearningServices/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/OperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/OperationsExtensions.cs new file mode 100644 index 0000000000000..08e4338586b43 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/OperationsExtensions.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available Azure Machine Learning Workspaces REST API + /// operations. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available Azure Machine Learning Workspaces REST API + /// operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperations.cs new file mode 100644 index 0000000000000..3d7cad533ed7e --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -0,0 +1,654 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + internal partial class PrivateEndpointConnectionsOperations : IServiceOperations, IPrivateEndpointConnectionsOperations + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateEndpointConnectionsOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Gets the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + + /// + /// Update the state of specified private endpoint connection associated with + /// the workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// The private endpoint connection properties. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PutWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string privateEndpointConnectionName, PrivateEndpointConnection properties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (properties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "properties"); + } + if (properties != null) + { + properties.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("properties", properties); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Put", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(properties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(properties, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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 the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 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; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs new file mode 100644 index 0000000000000..5f320034317ab --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -0,0 +1,172 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateEndpointConnectionsOperations. + /// + public static partial class PrivateEndpointConnectionsOperationsExtensions + { + /// + /// Gets the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName) + { + return operations.GetAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the state of specified private endpoint connection associated with + /// the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// The private endpoint connection properties. + /// + public static PrivateEndpointConnection Put(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, PrivateEndpointConnection properties) + { + return operations.PutAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, properties).GetAwaiter().GetResult(); + } + + /// + /// Update the state of specified private endpoint connection associated with + /// the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// The private endpoint connection properties. + /// + /// + /// The cancellation token. + /// + public static async Task PutAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, PrivateEndpointConnection properties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PutWithHttpMessagesAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, properties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + public static void Delete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The name of the private endpoint connection associated with the workspace + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperations.cs new file mode 100644 index 0000000000000..2011bbd6c332c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperations.cs @@ -0,0 +1,250 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateLinkResourcesOperations operations. + /// + internal partial class PrivateLinkResourcesOperations : IServiceOperations, IPrivateLinkResourcesOperations + { + /// + /// Initializes a new instance of the PrivateLinkResourcesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateLinkResourcesOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Gets the private link resources that need to be created for a workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperationsExtensions.cs new file mode 100644 index 0000000000000..8b21778d1a1ba --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperationsExtensions.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateLinkResourcesOperations. + /// + public static partial class PrivateLinkResourcesOperationsExtensions + { + /// + /// Gets the private link resources that need to be created for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static PrivateLinkResourceListResult ListByWorkspace(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link resources that need to be created for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task ListByWorkspaceAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperations.cs new file mode 100644 index 0000000000000..a291d7f2f064b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperations.cs @@ -0,0 +1,624 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// QuotasOperations operations. + /// + internal partial class QuotasOperations : IServiceOperations, IQuotasOperations + { + /// + /// Initializes a new instance of the QuotasOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal QuotasOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Update quota for each VM family in workspace. + /// + /// + /// The location for update quota is queried. + /// + /// + /// Quota update parameters. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string location, QuotaUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/Quotas").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperationsExtensions.cs new file mode 100644 index 0000000000000..fafdf2338eb45 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperationsExtensions.cs @@ -0,0 +1,133 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for QuotasOperations. + /// + public static partial class QuotasOperationsExtensions + { + /// + /// Update quota for each VM family in workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for update quota is queried. + /// + /// + /// Quota update parameters. + /// + public static UpdateWorkspaceQuotasResult Update(this IQuotasOperations operations, string location, QuotaUpdateParameters parameters) + { + return operations.UpdateAsync(location, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update quota for each VM family in workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for update quota is queried. + /// + /// + /// Quota update parameters. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IQuotasOperations operations, string location, QuotaUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for which resource usage is queried. + /// + public static IPage List(this IQuotasOperations operations, string location) + { + return operations.ListAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IQuotasOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IQuotasOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IQuotasOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/SdkInfo_AzureMachineLearningWorkspaces.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/SdkInfo_AzureMachineLearningWorkspaces.cs new file mode 100644 index 0000000000000..6607276030ed5 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/SdkInfo_AzureMachineLearningWorkspaces.cs @@ -0,0 +1,36 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_AzureMachineLearningWorkspaces + { + get + { + return new Tuple[] + { + new Tuple("MachineLearningServices", "ListSkus", "2020-04-01"), + new Tuple("MachineLearningServices", "MachineLearningCompute", "2020-04-01"), + new Tuple("MachineLearningServices", "Operations", "2020-04-01"), + new Tuple("MachineLearningServices", "PrivateEndpointConnections", "2020-04-01"), + new Tuple("MachineLearningServices", "PrivateLinkResources", "2020-04-01"), + new Tuple("MachineLearningServices", "Quotas", "2020-04-01"), + new Tuple("MachineLearningServices", "Usages", "2020-04-01"), + new Tuple("MachineLearningServices", "VirtualMachineSizes", "2020-04-01"), + new Tuple("MachineLearningServices", "WorkspaceFeatures", "2020-04-01"), + new Tuple("MachineLearningServices", "Workspaces", "2020-04-01"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperations.cs new file mode 100644 index 0000000000000..3fbe0d02add21 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperations.cs @@ -0,0 +1,423 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// UsagesOperations operations. + /// + internal partial class UsagesOperations : IServiceOperations, IUsagesOperations + { + /// + /// Initializes a new instance of the UsagesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal UsagesOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Gets the current usage information as well as limits for AML resources for + /// given subscription and location. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the current usage information as well as limits for AML resources for + /// given subscription and location. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperationsExtensions.cs new file mode 100644 index 0000000000000..f3fbb71e7a9b8 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperationsExtensions.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for UsagesOperations. + /// + public static partial class UsagesOperationsExtensions + { + /// + /// Gets the current usage information as well as limits for AML resources for + /// given subscription and location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for which resource usage is queried. + /// + public static IPage List(this IUsagesOperations operations, string location) + { + return operations.ListAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Gets the current usage information as well as limits for AML resources for + /// given subscription and location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IUsagesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the current usage information as well as limits for AML resources for + /// given subscription and location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IUsagesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the current usage information as well as limits for AML resources for + /// given subscription and location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IUsagesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperations.cs new file mode 100644 index 0000000000000..e51e45035556f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperations.cs @@ -0,0 +1,248 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// VirtualMachineSizesOperations operations. + /// + internal partial class VirtualMachineSizesOperations : IServiceOperations, IVirtualMachineSizesOperations + { + /// + /// Initializes a new instance of the VirtualMachineSizesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal VirtualMachineSizesOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Returns supported VM Sizes in a location + /// + /// + /// The location upon which virtual-machine-sizes is queried. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperationsExtensions.cs new file mode 100644 index 0000000000000..d6b5f57d895ea --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperationsExtensions.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for VirtualMachineSizesOperations. + /// + public static partial class VirtualMachineSizesOperationsExtensions + { + /// + /// Returns supported VM Sizes in a location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location upon which virtual-machine-sizes is queried. + /// + public static VirtualMachineSizeListResult List(this IVirtualMachineSizesOperations operations, string location) + { + return operations.ListAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Returns supported VM Sizes in a location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location upon which virtual-machine-sizes is queried. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IVirtualMachineSizesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperations.cs new file mode 100644 index 0000000000000..0481e0de14d1a --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperations.cs @@ -0,0 +1,413 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspaceFeaturesOperations operations. + /// + internal partial class WorkspaceFeaturesOperations : IServiceOperations, IWorkspaceFeaturesOperations + { + /// + /// Initializes a new instance of the WorkspaceFeaturesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspaceFeaturesOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Lists all enabled features for a workspace + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all enabled features for a workspace + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperationsExtensions.cs new file mode 100644 index 0000000000000..9e4cbbb6d065b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperationsExtensions.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspaceFeaturesOperations. + /// + public static partial class WorkspaceFeaturesOperationsExtensions + { + /// + /// Lists all enabled features for a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static IPage List(this IWorkspaceFeaturesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Lists all enabled features for a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWorkspaceFeaturesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all enabled features for a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IWorkspaceFeaturesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all enabled features for a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IWorkspaceFeaturesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperations.cs new file mode 100644 index 0000000000000..ccc52e9b5b7b4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperations.cs @@ -0,0 +1,1946 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspacesOperations operations. + /// + internal partial class WorkspacesOperations : IServiceOperations, IWorkspacesOperations + { + /// + /// Initializes a new instance of the WorkspacesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspacesOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// 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.MachineLearningServices/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for updating a machine learning workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspaceUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Continuation token for pagination. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("skiptoken", skiptoken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Resync all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task ResyncKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ResyncKeys", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// Continuation token for pagination. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySubscriptionWithHttpMessagesAsync(string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("skiptoken", skiptoken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new MachineLearningServiceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MachineLearningServiceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperationsExtensions.cs new file mode 100644 index 0000000000000..fea7be3d990aa --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperationsExtensions.cs @@ -0,0 +1,471 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspacesOperations. + /// + public static partial class WorkspacesOperationsExtensions + { + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static Workspace Get(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.GetAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + public static Workspace CreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static void Delete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + operations.DeleteAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for updating a machine learning workspace. + /// + public static Workspace Update(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspaceUpdateParameters parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for updating a machine learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspaceUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Continuation token for pagination. + /// + public static IPage ListByResourceGroup(this IWorkspacesOperations operations, string resourceGroupName, string skiptoken = default(string)) + { + return operations.ListByResourceGroupAsync(resourceGroupName, skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Continuation token for pagination. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IWorkspacesOperations operations, string resourceGroupName, string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static ListWorkspaceKeysResult ListKeys(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListKeysAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task ListKeysAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Resync all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static void ResyncKeys(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + operations.ResyncKeysAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Resync all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task ResyncKeysAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ResyncKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Continuation token for pagination. + /// + public static IPage ListBySubscription(this IWorkspacesOperations operations, string skiptoken = default(string)) + { + return operations.ListBySubscriptionAsync(skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Continuation token for pagination. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IWorkspacesOperations operations, string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + public static Workspace BeginCreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group in which workspace is located. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IWorkspacesOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IWorkspacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this IWorkspacesOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionNextAsync(this IWorkspacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}