From 3332ce2b0e43197a3625cfcfd45c5fa907e046ab Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 14 Jan 2022 07:43:07 +0000 Subject: [PATCH] CodeGen from PR 17361 in Azure/azure-rest-api-specs Merge 851e9c976ec7ed30c31483c4eb00fa7a419b646a into d72b193573bb076d190e410adfd2bb95b569fbb6 --- .../AzureMachineLearningWorkspacesClient.cs | 425 ++ .../src/Generated/ComputeOperations.cs | 2811 +++++++++++++ .../Generated/ComputeOperationsExtensions.cs | 873 ++++ .../IAzureMachineLearningWorkspacesClient.cs | 129 + .../src/Generated/IComputeOperations.cs | 530 +++ .../src/Generated/IOperations.cs | 47 + .../IPrivateEndpointConnectionsOperations.cs | 143 + .../IPrivateLinkResourcesOperations.cs | 53 + .../src/Generated/IQuotasOperations.cs | 96 + .../src/Generated/IUsagesOperations.cs | 73 + .../IVirtualMachineSizesOperations.cs | 49 + .../IWorkspaceConnectionsOperations.cs | 142 + .../Generated/IWorkspaceFeaturesOperations.cs | 74 + .../src/Generated/IWorkspaceSkusOperations.cs | 68 + .../src/Generated/IWorkspacesOperations.cs | 559 +++ .../src/Generated/Models/AKS.cs | 88 + .../src/Generated/Models/AKSProperties.cs | 141 + .../src/Generated/Models/AksComputeSecrets.cs | 100 + .../Models/AksComputeSecretsProperties.cs | 74 + .../Models/AksNetworkingConfiguration.cs | 119 + .../src/Generated/Models/AllocationState.cs | 22 + .../src/Generated/Models/AmlCompute.cs | 88 + .../Models/AmlComputeNodeInformation.cs | 112 + .../Generated/Models/AmlComputeProperties.cs | 260 ++ .../src/Generated/Models/AmlUserFeature.cs | 68 + .../Models/ApplicationSharingPolicy.cs | 22 + .../src/Generated/Models/AssignedUser.cs | 77 + .../Generated/Models/AutoPauseProperties.cs | 55 + .../Generated/Models/AutoScaleProperties.cs | 61 + .../Generated/Models/AzureEntityResource.cs | 62 + .../src/Generated/Models/ClusterPurpose.cs | 23 + .../Models/ClusterUpdateParameters.cs | 67 + .../src/Generated/Models/Compute.cs | 135 + .../Models/ComputeCreateOrUpdateHeaders.cs | 54 + .../Generated/Models/ComputeDeleteHeaders.cs | 61 + .../src/Generated/Models/ComputeInstance.cs | 88 + .../Models/ComputeInstanceApplication.cs | 60 + .../ComputeInstanceAuthorizationType.cs | 21 + .../ComputeInstanceConnectivityEndpoints.cs | 66 + .../Models/ComputeInstanceCreatedBy.cs | 69 + .../Models/ComputeInstanceLastOperation.cs | 77 + .../Models/ComputeInstanceProperties.cs | 208 + .../Models/ComputeInstanceSshSettings.cs | 86 + .../Generated/Models/ComputeInstanceState.cs | 35 + .../src/Generated/Models/ComputeResource.cs | 102 + .../src/Generated/Models/ComputeSecrets.cs | 36 + .../src/Generated/Models/ComputeType.cs | 30 + .../Models/ContainerResourceRequirements.cs | 111 + .../src/Generated/Models/CosmosDbSettings.cs | 49 + .../src/Generated/Models/CreatedByType.cs | 24 + .../src/Generated/Models/DataFactory.cs | 66 + .../src/Generated/Models/DataLakeAnalytics.cs | 73 + .../Models/DataLakeAnalyticsProperties.cs | 51 + .../src/Generated/Models/Databricks.cs | 73 + .../Models/DatabricksComputeSecrets.cs | 80 + .../DatabricksComputeSecretsProperties.cs | 54 + .../Generated/Models/DatabricksProperties.cs | 59 + .../Models/DiagnoseRequestProperties.cs | 124 + .../Models/DiagnoseResponseResult.cs | 46 + .../Models/DiagnoseResponseResultValue.cs | 98 + .../src/Generated/Models/DiagnoseResult.cs | 69 + .../Generated/Models/DiagnoseResultLevel.cs | 23 + .../Models/DiagnoseWorkspaceParameters.cs | 53 + .../Generated/Models/EncryptionProperty.cs | 92 + .../src/Generated/Models/EncryptionStatus.cs | 22 + .../Generated/Models/ErrorAdditionalInfo.cs | 59 + .../src/Generated/Models/ErrorDetail.cs | 85 + .../src/Generated/Models/ErrorResponse.cs | 56 + .../Models/ErrorResponseException.cs | 62 + .../src/Generated/Models/EstimatedVMPrice.cs | 97 + .../src/Generated/Models/EstimatedVMPrices.cs | 103 + .../Generated/Models/ExternalFQDNResponse.cs | 48 + .../src/Generated/Models/FQDNEndpoint.cs | 54 + .../Generated/Models/FQDNEndpointDetail.cs | 46 + .../src/Generated/Models/FQDNEndpoints.cs | 46 + .../Models/FQDNEndpointsProperties.cs | 54 + .../src/Generated/Models/HDInsight.cs | 73 + .../Generated/Models/HDInsightProperties.cs | 71 + .../src/Generated/Models/Identity.cs | 84 + .../src/Generated/Models/IdentityForCmk.cs | 54 + .../Generated/Models/InstanceTypeSchema.cs | 62 + .../Models/InstanceTypeSchemaResources.cs | 64 + .../Generated/Models/KeyVaultProperties.cs | 87 + .../src/Generated/Models/Kubernetes.cs | 171 + .../Generated/Models/KubernetesProperties.cs | 112 + .../src/Generated/Models/KubernetesSchema.cs | 51 + .../Models/ListNotebookKeysResult.cs | 52 + .../Models/ListStorageAccountKeysResult.cs | 48 + .../Models/ListWorkspaceKeysResult.cs | 70 + .../src/Generated/Models/LoadBalancerType.cs | 22 + .../src/Generated/Models/NodeState.cs | 26 + .../src/Generated/Models/NodeStateCounts.cs | 109 + .../Models/NotebookAccessTokenResult.cs | 88 + .../Models/NotebookPreparationError.cs | 52 + .../Generated/Models/NotebookResourceInfo.cs | 65 + .../src/Generated/Models/Operation.cs | 60 + .../src/Generated/Models/OperationDisplay.cs | 80 + .../src/Generated/Models/OperationName.cs | 26 + .../src/Generated/Models/OperationStatus.cs | 28 + .../src/Generated/Models/OsType.cs | 22 + .../src/Generated/Models/Page.cs | 53 + .../src/Generated/Models/Page1.cs | 53 + .../src/Generated/Models/Page2.cs | 53 + .../src/Generated/Models/Password.cs | 52 + .../Models/PersonalComputeInstanceSettings.cs | 69 + .../src/Generated/Models/PrivateEndpoint.cs | 61 + .../Models/PrivateEndpointConnection.cs | 142 + ...vateEndpointConnectionProvisioningState.cs | 24 + .../PrivateEndpointServiceConnectionStatus.cs | 25 + .../Generated/Models/PrivateLinkResource.cs | 123 + .../Models/PrivateLinkResourceListResult.cs | 55 + .../PrivateLinkServiceConnectionState.cs | 79 + .../src/Generated/Models/ProvisioningState.cs | 27 + .../src/Generated/Models/ProxyResource.cs | 53 + .../Generated/Models/PublicNetworkAccess.cs | 22 + .../Generated/Models/QuotaBaseProperties.cs | 80 + .../src/Generated/Models/QuotaUnit.cs | 21 + .../Generated/Models/QuotaUpdateParameters.cs | 62 + .../src/Generated/Models/ReasonCode.cs | 23 + .../Models/RegistryListCredentialsResult.cs | 62 + .../Models/RemoteLoginPortPublicAccess.cs | 23 + .../src/Generated/Models/Resource.cs | 79 + .../src/Generated/Models/ResourceId.cs | 67 + .../Generated/Models/ResourceIdentityType.cs | 72 + .../src/Generated/Models/ResourceName.cs | 60 + .../src/Generated/Models/ResourceQuota.cs | 97 + .../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 | 80 + .../Models/ScaleSettingsInformation.cs | 64 + .../src/Generated/Models/ScriptReference.cs | 80 + .../src/Generated/Models/ScriptsToExecute.cs | 62 + .../Models/ServiceManagedResourcesSettings.cs | 51 + .../Models/ServicePrincipalCredentials.cs | 79 + .../src/Generated/Models/SetupScripts.cs | 51 + .../Models/SharedPrivateLinkResource.cs | 90 + .../src/Generated/Models/Sku.cs | 59 + .../src/Generated/Models/SshPublicAccess.cs | 22 + .../src/Generated/Models/SslConfiguration.cs | 95 + .../src/Generated/Models/Status.cs | 28 + .../src/Generated/Models/SynapseSpark.cs | 73 + .../Models/SynapseSparkProperties.cs | 125 + .../src/Generated/Models/SystemData.cs | 103 + .../src/Generated/Models/SystemService.cs | 68 + .../src/Generated/Models/TrackedResource.cs | 87 + .../Models/UnderlyingResourceAction.cs | 22 + .../Generated/Models/UpdateWorkspaceQuotas.cs | 95 + .../Models/UpdateWorkspaceQuotasResult.cs | 68 + .../src/Generated/Models/Usage.cs | 104 + .../src/Generated/Models/UsageName.cs | 60 + .../src/Generated/Models/UsageUnit.cs | 21 + .../Models/UserAccountCredentials.cs | 92 + .../Generated/Models/UserAssignedIdentity.cs | 70 + .../src/Generated/Models/VMPriceOSType.cs | 22 + .../src/Generated/Models/VMTier.cs | 23 + .../src/Generated/Models/ValueFormat.cs | 21 + .../src/Generated/Models/VirtualMachine.cs | 73 + .../Generated/Models/VirtualMachineImage.cs | 65 + .../Models/VirtualMachineProperties.cs | 84 + .../Generated/Models/VirtualMachineSecrets.cs | 53 + .../Generated/Models/VirtualMachineSize.cs | 180 + .../Models/VirtualMachineSizeListResult.cs | 57 + .../Models/VirtualMachineSshCredentials.cs | 77 + .../src/Generated/Models/VmPriority.cs | 22 + .../src/Generated/Models/Workspace.cs | 370 ++ .../Generated/Models/WorkspaceConnection.cs | 117 + .../src/Generated/Models/WorkspaceSku.cs | 106 + .../Models/WorkspaceUpdateParameters.cs | 131 + .../Models/WorkspacesDiagnoseHeaders.cs | 62 + .../src/Generated/Operations.cs | 230 ++ .../src/Generated/OperationsExtensions.cs | 57 + .../PrivateEndpointConnectionsOperations.cs | 945 +++++ ...EndpointConnectionsOperationsExtensions.cs | 214 + .../PrivateLinkResourcesOperations.cs | 275 ++ ...rivateLinkResourcesOperationsExtensions.cs | 65 + .../src/Generated/QuotasOperations.cs | 642 +++ .../Generated/QuotasOperationsExtensions.cs | 133 + .../SdkInfo_AzureMachineLearningWorkspaces.cs | 37 + .../src/Generated/UsagesOperations.cs | 437 ++ .../Generated/UsagesOperationsExtensions.cs | 97 + .../VirtualMachineSizesOperations.cs | 262 ++ ...VirtualMachineSizesOperationsExtensions.cs | 59 + .../WorkspaceConnectionsOperations.cs | 954 +++++ ...orkspaceConnectionsOperationsExtensions.cs | 220 + .../Generated/WorkspaceFeaturesOperations.cs | 438 ++ .../WorkspaceFeaturesOperationsExtensions.cs | 99 + .../src/Generated/WorkspaceSkusOperations.cs | 409 ++ .../WorkspaceSkusOperationsExtensions.cs | 87 + .../src/Generated/WorkspacesOperations.cs | 3529 +++++++++++++++++ .../WorkspacesOperationsExtensions.cs | 881 ++++ 192 files changed, 27183 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/ComputeOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/ComputeOperationsExtensions.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/IComputeOperations.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/IWorkspaceConnectionsOperations.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/IWorkspaceSkusOperations.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/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/AksComputeSecretsProperties.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/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/ApplicationSharingPolicy.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AssignedUser.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AutoPauseProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AutoScaleProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AzureEntityResource.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ClusterPurpose.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/ComputeCreateOrUpdateHeaders.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeDeleteHeaders.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstance.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceApplication.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceAuthorizationType.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceConnectivityEndpoints.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceCreatedBy.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceLastOperation.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceSshSettings.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceState.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/ContainerResourceRequirements.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/CosmosDbSettings.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/CreatedByType.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/DatabricksComputeSecretsProperties.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/DiagnoseRequestProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResponseResult.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResponseResultValue.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResult.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResultLevel.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseWorkspaceParameters.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/ErrorAdditionalInfo.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/EstimatedVMPrice.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EstimatedVMPrices.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ExternalFQDNResponse.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpoint.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpointDetail.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpoints.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpointsProperties.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/IdentityForCmk.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/InstanceTypeSchema.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/InstanceTypeSchemaResources.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/Kubernetes.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KubernetesProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KubernetesSchema.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListNotebookKeysResult.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListStorageAccountKeysResult.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/LoadBalancerType.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/NotebookAccessTokenResult.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookPreparationError.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookResourceInfo.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/OperationName.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationStatus.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OsType.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/Page2.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/PersonalComputeInstanceSettings.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/ProxyResource.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PublicNetworkAccess.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/ScaleSettingsInformation.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScriptReference.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScriptsToExecute.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ServiceManagedResourcesSettings.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/SetupScripts.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/SshPublicAccess.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/SynapseSpark.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SynapseSparkProperties.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SystemData.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/TrackedResource.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/UserAssignedIdentity.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VMPriceOSType.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VMTier.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ValueFormat.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/VirtualMachineImage.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/WorkspaceConnection.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/Models/WorkspacesDiagnoseHeaders.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/WorkspaceConnectionsOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceConnectionsOperationsExtensions.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/WorkspaceSkusOperations.cs create mode 100644 sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceSkusOperationsExtensions.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..aacf585fd3a95 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/AzureMachineLearningWorkspacesClient.cs @@ -0,0 +1,425 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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; + + /// + /// 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; } + + /// + /// The API version to use for this operation. + /// + public string ApiVersion { get; private set; } + + /// + /// The ID of the target subscription. + /// + public string SubscriptionId { get; 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 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 IComputeOperations. + /// + public virtual IComputeOperations Compute { get; private set; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + + /// + /// Gets the IWorkspaceConnectionsOperations. + /// + public virtual IWorkspaceConnectionsOperations WorkspaceConnections { get; private set; } + + /// + /// Gets the IWorkspaceFeaturesOperations. + /// + public virtual IWorkspaceFeaturesOperations WorkspaceFeatures { get; private set; } + + /// + /// Gets the IWorkspaceSkusOperations. + /// + public virtual IWorkspaceSkusOperations WorkspaceSkus { 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); + Usages = new UsagesOperations(this); + VirtualMachineSizes = new VirtualMachineSizesOperations(this); + Quotas = new QuotasOperations(this); + Compute = new ComputeOperations(this); + PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); + PrivateLinkResources = new PrivateLinkResourcesOperations(this); + WorkspaceConnections = new WorkspaceConnectionsOperations(this); + WorkspaceFeatures = new WorkspaceFeaturesOperations(this); + WorkspaceSkus = new WorkspaceSkusOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2021-07-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")); + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/ComputeOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/ComputeOperations.cs new file mode 100644 index 0000000000000..9fe104eb5ba90 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/ComputeOperations.cs @@ -0,0 +1,2811 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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; + + /// + /// ComputeOperations operations. + /// + internal partial class ComputeOperations : IServiceOperations, IComputeOperations + { + /// + /// Initializes a new instance of the ComputeOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ComputeOperations(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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string skip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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("skip", skip); + 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}/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 (skip != null) + { + _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(skip))); + } + 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; + } + + /// + /// Gets compute definition by its name. Any secrets (storage keys, service + /// credentials, etc) are not returned - use 'keys' nested resource to get + /// them. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates 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 name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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 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; + } + + /// + /// Gets secrets related to Machine Learning compute (storage keys, service + /// credentials, etc). + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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 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; + } + + /// + /// Posts a start action to a compute instance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StartWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Posts a stop action to a compute instance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StopWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Posts a restart action to a compute instance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// 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 name of the resource group. The name is case insensitive. + /// + /// + /// 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 (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + 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, "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 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); + } + } + // 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + 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 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 specified Machine Learning compute. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + 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 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 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; + } + + /// + /// Posts a start action to a compute instance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginStartWithHttpMessagesAsync(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 (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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, "BeginStart", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + 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; + } + + /// + /// Posts a stop action to a compute instance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginStopWithHttpMessagesAsync(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 (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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, "BeginStop", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + 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; + } + + /// + /// Posts a restart action to a compute instance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginRestartWithHttpMessagesAsync(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 (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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, "BeginRestart", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{computeName}", System.Uri.EscapeDataString(computeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + 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; + } + + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get the details (e.g IP address, port etc) of all the compute nodes in the + /// compute. + /// + /// + /// 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>> ListNodesNextWithHttpMessagesAsync(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, "ListNodesNext", 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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/ComputeOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/ComputeOperationsExtensions.cs new file mode 100644 index 0000000000000..de4af6c1e40ae --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/ComputeOperationsExtensions.cs @@ -0,0 +1,873 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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 ComputeOperations. + /// + public static partial class ComputeOperationsExtensions + { + /// + /// Gets computes in specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Continuation token for pagination. + /// + public static IPage List(this IComputeOperations operations, string resourceGroupName, string workspaceName, string skip = default(string)) + { + return operations.ListAsync(resourceGroupName, workspaceName, skip).GetAwaiter().GetResult(); + } + + /// + /// Gets computes in specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Continuation token for pagination. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IComputeOperations operations, string resourceGroupName, string workspaceName, string skip = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, skip, 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static ComputeResource Get(this IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + public static ComputeResource CreateOrUpdate(this IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + public static ComputeResource Update(this IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 ComputeDeleteHeaders Delete(this IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static IPage ListNodes(this IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNodesAsync(this IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static ComputeSecrets ListKeys(this IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task ListKeysAsync(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Posts a start action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static void Start(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + operations.StartAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Posts a start action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task StartAsync(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.StartWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Posts a stop action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static void Stop(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + operations.StopAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Posts a stop action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task StopAsync(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.StopWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Posts a restart action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static void Restart(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + operations.RestartAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Posts a restart action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task RestartAsync(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RestartWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates compute. This call will overwrite a compute if it + /// exists. This is a nonrecoverable operation. If your intent is to create a + /// new compute, do a GET first to verify that it does not exist yet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Payload with Machine Learning compute definition. + /// + public static ComputeResource BeginCreateOrUpdate(this IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// Additional parameters for cluster update. + /// + public static ComputeResource BeginUpdate(this IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 ComputeDeleteHeaders BeginDelete(this IComputeOperations 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 IComputeOperations 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; + } + } + + /// + /// Posts a start action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static void BeginStart(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + operations.BeginStartAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Posts a start action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task BeginStartAsync(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Posts a stop action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static void BeginStop(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + operations.BeginStopAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Posts a stop action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task BeginStopAsync(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Posts a restart action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + public static void BeginRestart(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName) + { + operations.BeginRestartAsync(resourceGroupName, workspaceName, computeName).GetAwaiter().GetResult(); + } + + /// + /// Posts a restart action to a compute instance + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRestartAsync(this IComputeOperations operations, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, workspaceName, computeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// 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 ListNext(this IComputeOperations operations, string nextPageLink) + { + return operations.ListNextAsync(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> ListNextAsync(this IComputeOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the details (e.g IP address, port etc) of all the compute nodes in the + /// compute. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNodesNext(this IComputeOperations operations, string nextPageLink) + { + return operations.ListNodesNextAsync(nextPageLink).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. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNodesNextAsync(this IComputeOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNodesNextWithHttpMessagesAsync(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..5731b130430ec --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IAzureMachineLearningWorkspacesClient.cs @@ -0,0 +1,129 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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; + + /// + /// 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; } + + /// + /// The API version to use for this operation. + /// + string ApiVersion { get; } + + /// + /// The ID of the target subscription. + /// + string SubscriptionId { get; set; } + + /// + /// 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 IUsagesOperations. + /// + IUsagesOperations Usages { get; } + + /// + /// Gets the IVirtualMachineSizesOperations. + /// + IVirtualMachineSizesOperations VirtualMachineSizes { get; } + + /// + /// Gets the IQuotasOperations. + /// + IQuotasOperations Quotas { get; } + + /// + /// Gets the IComputeOperations. + /// + IComputeOperations Compute { get; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + IPrivateLinkResourcesOperations PrivateLinkResources { get; } + + /// + /// Gets the IWorkspaceConnectionsOperations. + /// + IWorkspaceConnectionsOperations WorkspaceConnections { get; } + + /// + /// Gets the IWorkspaceFeaturesOperations. + /// + IWorkspaceFeaturesOperations WorkspaceFeatures { get; } + + /// + /// Gets the IWorkspaceSkusOperations. + /// + IWorkspaceSkusOperations WorkspaceSkus { get; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IComputeOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IComputeOperations.cs new file mode 100644 index 0000000000000..b89d31fdbecbb --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IComputeOperations.cs @@ -0,0 +1,530 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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; + + /// + /// ComputeOperations operations. + /// + public partial interface IComputeOperations + { + /// + /// Gets computes in specified workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string skip = 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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). + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Posts a start action to a compute instance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task StartWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Posts a stop action to a compute instance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task StopWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Posts a restart action to a compute instance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RestartWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates compute. This call will overwrite a compute if + /// it exists. This is a nonrecoverable operation. If your intent is to + /// create a new compute, do a GET first to verify that it does not + /// exist yet. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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)); + /// + /// Posts a start action to a compute instance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Posts a stop action to a compute instance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Posts a restart action to a compute instance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Name of the Azure Machine Learning compute. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string computeName, 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the details (e.g IP address, port etc) of all the compute nodes + /// in the compute. + /// + /// + /// 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>> ListNodesNextWithHttpMessagesAsync(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..732ec4476da5e --- /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..4788cafe2e6f2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IPrivateEndpointConnectionsOperations.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 +{ + 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 + { + /// + /// List all the private endpoint connections associated with the + /// workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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)); + /// + /// Gets the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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..e680ad2f74c54 --- /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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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)); + } +} 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..31aad2fdfe5aa --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IQuotasOperations.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// QuotasOperations operations. + /// + public partial interface IQuotasOperations + { + /// + /// Update quota for each VM family in workspace. + /// + /// + /// The location for update quota is queried. + /// + /// + /// Quota update parameters. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string location, QuotaUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently assigned Workspace Quotas based on VMFamily. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IUsagesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IUsagesOperations.cs new file mode 100644 index 0000000000000..6864e81d92e6f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IUsagesOperations.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// UsagesOperations operations. + /// + public partial interface IUsagesOperations + { + /// + /// Gets the current usage information as well as limits for AML + /// resources for given subscription and location. + /// + /// + /// The location for which resource usage is queried. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the current usage information as well as limits for AML + /// resources for given subscription and location. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IVirtualMachineSizesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IVirtualMachineSizesOperations.cs new file mode 100644 index 0000000000000..08c5562882ffd --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IVirtualMachineSizesOperations.cs @@ -0,0 +1,49 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// VirtualMachineSizesOperations operations. + /// + public partial interface IVirtualMachineSizesOperations + { + /// + /// Returns supported VM Sizes in a location + /// + /// + /// The location upon which virtual-machine-sizes is queried. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceConnectionsOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceConnectionsOperations.cs new file mode 100644 index 0000000000000..53d8f26908185 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceConnectionsOperations.cs @@ -0,0 +1,142 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspaceConnectionsOperations operations. + /// + public partial interface IWorkspaceConnectionsOperations + { + /// + /// List all connections under a AML workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Target of the workspace connection. + /// + /// + /// Category of the workspace connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string target = default(string), string category = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Add a new workspace connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The object for creating or updating a new workspace connection + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string connectionName, WorkspaceConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the detail of a workspace connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a workspace connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceFeaturesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceFeaturesOperations.cs new file mode 100644 index 0000000000000..8fe264b2d19b3 --- /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 + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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/IWorkspaceSkusOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceSkusOperations.cs new file mode 100644 index 0000000000000..d08466e3ae613 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspaceSkusOperations.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspaceSkusOperations operations. + /// + public partial interface IWorkspaceSkusOperations + { + /// + /// Lists all skus with associated features + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all 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. + /// + /// + /// 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..4a7bc5745e1d4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/IWorkspacesOperations.cs @@ -0,0 +1,559 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 skip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Diagnose workspace setup issue. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameter of diagnosing workspace health + /// + /// + /// 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> DiagnoseWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DiagnoseWorkspaceParameters parameters = default(DiagnoseWorkspaceParameters), 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 + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 skip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// return notebook access token and refresh token + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> ListNotebookAccessTokenWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Prepare a notebook. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> PrepareNotebookWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List storage account keys of a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> ListStorageAccountKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List keys of a notebook. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> ListNotebookKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Called by Client (Portal, CLI, etc) to get a list of all external + /// outbound dependencies (FQDNs) programmatically. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> ListOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning + /// workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a machine learning workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Diagnose workspace setup issue. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameter of diagnosing workspace health + /// + /// + /// 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> BeginDiagnoseWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DiagnoseWorkspaceParameters parameters = default(DiagnoseWorkspaceParameters), 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 + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 BeginResyncKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Prepare a notebook. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> BeginPrepareNotebookWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the available machine learning workspaces under the + /// specified subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKS.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKS.cs new file mode 100644 index 0000000000000..28408bfc66629 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKS.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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A Machine Learning compute based on AKS. + /// + public partial class AKS : Compute + { + /// + /// Initializes a new instance of the AKS class. + /// + public AKS() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AKS class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The time at which the compute was + /// created. + /// The time at which 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. + /// Opt-out of local authentication and + /// ensure customers can use only MSI and AAD exclusively for + /// authentication. + /// 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?), bool? disableLocalAuth = default(bool?), AKSProperties properties = default(AKSProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute, disableLocalAuth) + { + 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..0e04106f2bcbd --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AKSProperties.cs @@ -0,0 +1,141 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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 + /// Intended usage of the cluster. + /// Possible values include: 'FastProd', 'DenseProd', 'DevTest' + /// SSL configuration + /// AKS networking + /// configuration for vnet + /// Load Balancer Type. Possible values + /// include: 'PublicIp', 'InternalLoadBalancer' + /// Load Balancer Subnet + public AKSProperties(string clusterFqdn = default(string), IList systemServices = default(IList), int? agentCount = default(int?), string agentVmSize = default(string), string clusterPurpose = default(string), SslConfiguration sslConfiguration = default(SslConfiguration), AksNetworkingConfiguration aksNetworkingConfiguration = default(AksNetworkingConfiguration), string loadBalancerType = default(string), string loadBalancerSubnet = default(string)) + { + ClusterFqdn = clusterFqdn; + SystemServices = systemServices; + AgentCount = agentCount; + AgentVmSize = agentVmSize; + ClusterPurpose = clusterPurpose; + SslConfiguration = sslConfiguration; + AksNetworkingConfiguration = aksNetworkingConfiguration; + LoadBalancerType = loadBalancerType; + LoadBalancerSubnet = loadBalancerSubnet; + 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 intended usage of the cluster. Possible values + /// include: 'FastProd', 'DenseProd', 'DevTest' + /// + [JsonProperty(PropertyName = "clusterPurpose")] + public string ClusterPurpose { 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; } + + /// + /// Gets or sets load Balancer Type. Possible values include: + /// 'PublicIp', 'InternalLoadBalancer' + /// + [JsonProperty(PropertyName = "loadBalancerType")] + public string LoadBalancerType { get; set; } + + /// + /// Gets or sets load Balancer Subnet + /// + [JsonProperty(PropertyName = "loadBalancerSubnet")] + public string LoadBalancerSubnet { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AgentCount < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "AgentCount", 0); + } + 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..4bdfbfc90210e --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksComputeSecrets.cs @@ -0,0 +1,100 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Secrets related to a Machine Learning compute based on AKS. + /// + public partial class AksComputeSecrets + { + /// + /// Initializes a new instance of the AksComputeSecrets class. + /// + public AksComputeSecrets() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AksComputeSecrets class. + /// + /// The type of compute. Possible values + /// include: 'AKS', 'Kubernetes', 'AmlCompute', 'ComputeInstance', + /// 'DataFactory', 'VirtualMachine', 'HDInsight', 'Databricks', + /// 'DataLakeAnalytics', 'SynapseSpark' + /// 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 computeType, string userKubeConfig = default(string), string adminKubeConfig = default(string), string imagePullSecretName = default(string)) + { + ComputeType = computeType; + UserKubeConfig = userKubeConfig; + AdminKubeConfig = adminKubeConfig; + ImagePullSecretName = imagePullSecretName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the type of compute. Possible values include: 'AKS', + /// 'Kubernetes', 'AmlCompute', 'ComputeInstance', 'DataFactory', + /// 'VirtualMachine', 'HDInsight', 'Databricks', 'DataLakeAnalytics', + /// 'SynapseSpark' + /// + [JsonProperty(PropertyName = "computeType")] + public string ComputeType { get; set; } + + /// + /// 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; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ComputeType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ComputeType"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksComputeSecretsProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksComputeSecretsProperties.cs new file mode 100644 index 0000000000000..41f5aaad1f53d --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AksComputeSecretsProperties.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; + + /// + /// Properties of AksComputeSecrets + /// + public partial class AksComputeSecretsProperties + { + /// + /// Initializes a new instance of the AksComputeSecretsProperties + /// class. + /// + public AksComputeSecretsProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AksComputeSecretsProperties + /// 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 AksComputeSecretsProperties(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..a350d5fee5e13 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlCompute.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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Azure Machine Learning compute. + /// + public partial class AmlCompute : Compute + { + /// + /// Initializes a new instance of the AmlCompute class. + /// + public AmlCompute() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmlCompute class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The time at which the compute was + /// created. + /// The time at which 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. + /// Opt-out of local authentication and + /// ensure customers can use only MSI and AAD exclusively for + /// authentication. + /// Properties of AmlCompute + 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?), bool? disableLocalAuth = default(bool?), AmlComputeProperties properties = default(AmlComputeProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute, disableLocalAuth) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets properties of AmlCompute + /// + [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/AmlComputeProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeProperties.cs new file mode 100644 index 0000000000000..dc8821e171eea --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlComputeProperties.cs @@ -0,0 +1,260 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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. + /// + /// Compute OS Type. Possible values include: + /// 'Linux', 'Windows' + /// Virtual Machine Size + /// Virtual Machine priority. Possible values + /// include: 'Dedicated', 'LowPriority' + /// Virtual Machine image for AML + /// Compute - windows only + /// Network is isolated or not + /// 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. + /// Enable node public IP. + public AmlComputeProperties(string osType = default(string), string vmSize = default(string), string vmPriority = default(string), VirtualMachineImage virtualMachineImage = default(VirtualMachineImage), bool? isolatedNetwork = default(bool?), 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), bool? enableNodePublicIp = default(bool?)) + { + OsType = osType; + VmSize = vmSize; + VmPriority = vmPriority; + VirtualMachineImage = virtualMachineImage; + IsolatedNetwork = isolatedNetwork; + ScaleSettings = scaleSettings; + UserAccountCredentials = userAccountCredentials; + Subnet = subnet; + RemoteLoginPortPublicAccess = remoteLoginPortPublicAccess; + AllocationState = allocationState; + AllocationStateTransitionTime = allocationStateTransitionTime; + Errors = errors; + CurrentNodeCount = currentNodeCount; + TargetNodeCount = targetNodeCount; + NodeStateCounts = nodeStateCounts; + EnableNodePublicIp = enableNodePublicIp; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets compute OS Type. Possible values include: 'Linux', + /// 'Windows' + /// + [JsonProperty(PropertyName = "osType")] + public string OsType { get; set; } + + /// + /// 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 virtual Machine image for AML Compute - windows only + /// + [JsonProperty(PropertyName = "virtualMachineImage")] + public VirtualMachineImage VirtualMachineImage { get; set; } + + /// + /// Gets or sets network is isolated or not + /// + [JsonProperty(PropertyName = "isolatedNetwork")] + public bool? IsolatedNetwork { 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; } + + /// + /// Gets or sets enable node public IP. + /// + /// + /// Enable or disable node public IP address provisioning. Possible + /// values are: Possible values are: true - Indicates that the compute + /// nodes will have public IPs provisioned. false - Indicates that the + /// compute nodes will have a private endpoint and no public IPs. + /// + [JsonProperty(PropertyName = "enableNodePublicIp")] + public bool? EnableNodePublicIp { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VirtualMachineImage != null) + { + VirtualMachineImage.Validate(); + } + if (ScaleSettings != null) + { + ScaleSettings.Validate(); + } + if (UserAccountCredentials != null) + { + UserAccountCredentials.Validate(); + } + if (Subnet != null) + { + Subnet.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlUserFeature.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlUserFeature.cs new file mode 100644 index 0000000000000..e22d752edf7a0 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AmlUserFeature.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Features enabled for a workspace + /// + public partial class AmlUserFeature + { + /// + /// Initializes a new instance of the AmlUserFeature class. + /// + public AmlUserFeature() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmlUserFeature class. + /// + /// Specifies the feature ID + /// Specifies the feature name + /// Describes the feature for user + /// experience + public AmlUserFeature(string id = default(string), string displayName = default(string), string description = default(string)) + { + Id = id; + DisplayName = displayName; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the feature ID + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets specifies the feature name + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets describes the feature for user experience + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ApplicationSharingPolicy.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ApplicationSharingPolicy.cs new file mode 100644 index 0000000000000..2e090b18400e2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ApplicationSharingPolicy.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for ApplicationSharingPolicy. + /// + public static class ApplicationSharingPolicy + { + public const string Personal = "Personal"; + public const string Shared = "Shared"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AssignedUser.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AssignedUser.cs new file mode 100644 index 0000000000000..0aabf3cf72c26 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AssignedUser.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; + + /// + /// A user that can be assigned to a compute instance. + /// + public partial class AssignedUser + { + /// + /// Initializes a new instance of the AssignedUser class. + /// + public AssignedUser() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AssignedUser class. + /// + /// User’s AAD Object Id. + /// User’s AAD Tenant Id. + public AssignedUser(string objectId, string tenantId) + { + ObjectId = objectId; + TenantId = tenantId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets user’s AAD Object Id. + /// + [JsonProperty(PropertyName = "objectId")] + public string ObjectId { get; set; } + + /// + /// Gets or sets user’s AAD Tenant Id. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ObjectId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ObjectId"); + } + if (TenantId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AutoPauseProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AutoPauseProperties.cs new file mode 100644 index 0000000000000..e17f504d791db --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AutoPauseProperties.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.Linq; + + /// + /// Auto pause properties + /// + public partial class AutoPauseProperties + { + /// + /// Initializes a new instance of the AutoPauseProperties class. + /// + public AutoPauseProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AutoPauseProperties class. + /// + public AutoPauseProperties(int? delayInMinutes = default(int?), bool? enabled = default(bool?)) + { + DelayInMinutes = delayInMinutes; + Enabled = enabled; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "delayInMinutes")] + public int? DelayInMinutes { get; set; } + + /// + /// + [JsonProperty(PropertyName = "enabled")] + public bool? Enabled { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AutoScaleProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AutoScaleProperties.cs new file mode 100644 index 0000000000000..6fc2dcdb3b5f9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AutoScaleProperties.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Auto scale properties + /// + public partial class AutoScaleProperties + { + /// + /// Initializes a new instance of the AutoScaleProperties class. + /// + public AutoScaleProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AutoScaleProperties class. + /// + public AutoScaleProperties(int? minNodeCount = default(int?), bool? enabled = default(bool?), int? maxNodeCount = default(int?)) + { + MinNodeCount = minNodeCount; + Enabled = enabled; + MaxNodeCount = maxNodeCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "minNodeCount")] + public int? MinNodeCount { get; set; } + + /// + /// + [JsonProperty(PropertyName = "enabled")] + public bool? Enabled { get; set; } + + /// + /// + [JsonProperty(PropertyName = "maxNodeCount")] + public int? MaxNodeCount { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AzureEntityResource.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AzureEntityResource.cs new file mode 100644 index 0000000000000..8be7cf8033dda --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/AzureEntityResource.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.Linq; + + /// + /// Entity Resource + /// + /// + /// The resource model definition for an Azure Resource Manager resource + /// with an etag. + /// + public partial class AzureEntityResource : Resource + { + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + public AzureEntityResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource Etag. + public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + : base(id, name, type) + { + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Etag. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ClusterPurpose.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ClusterPurpose.cs new file mode 100644 index 0000000000000..8dab7387b2ee0 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ClusterPurpose.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 ClusterPurpose. + /// + public static class ClusterPurpose + { + public const string FastProd = "FastProd"; + public const string DenseProd = "DenseProd"; + public const string DevTest = "DevTest"; + } +} 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..954ebe15783a7 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ClusterUpdateParameters.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.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. + /// + /// Properties of ClusterUpdate + public ClusterUpdateParameters(ScaleSettingsInformation properties = default(ScaleSettingsInformation)) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets properties of ClusterUpdate + /// + [JsonProperty(PropertyName = "properties.properties")] + public ScaleSettingsInformation 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/Compute.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Compute.cs new file mode 100644 index 0000000000000..4f8889bbda616 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Compute.cs @@ -0,0 +1,135 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Machine Learning compute object. + /// + public partial class Compute + { + /// + /// Initializes a new instance of the Compute class. + /// + public Compute() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Compute class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The time at which the compute was + /// created. + /// The time at which 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. + /// Opt-out of local authentication and + /// ensure customers can use only MSI and AAD exclusively for + /// authentication. + 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?), bool? disableLocalAuth = default(bool?)) + { + ComputeLocation = computeLocation; + ProvisioningState = provisioningState; + Description = description; + CreatedOn = createdOn; + ModifiedOn = modifiedOn; + ResourceId = resourceId; + ProvisioningErrors = provisioningErrors; + IsAttachedCompute = isAttachedCompute; + DisableLocalAuth = disableLocalAuth; + 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 time at which the compute was created. + /// + [JsonProperty(PropertyName = "createdOn")] + public System.DateTime? CreatedOn { get; private set; } + + /// + /// Gets the time at which 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; } + + /// + /// Gets or sets opt-out of local authentication and ensure customers + /// can use only MSI and AAD exclusively for authentication. + /// + [JsonProperty(PropertyName = "disableLocalAuth")] + public bool? DisableLocalAuth { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeCreateOrUpdateHeaders.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..390e295e78312 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeCreateOrUpdateHeaders.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 ComputeCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the ComputeCreateOrUpdateHeaders + /// class. + /// + public ComputeCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeCreateOrUpdateHeaders + /// class. + /// + /// URI to poll for asynchronous + /// operation status. + public ComputeCreateOrUpdateHeaders(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/ComputeDeleteHeaders.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeDeleteHeaders.cs new file mode 100644 index 0000000000000..fa7552351c049 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeDeleteHeaders.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class ComputeDeleteHeaders + { + /// + /// Initializes a new instance of the ComputeDeleteHeaders class. + /// + public ComputeDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeDeleteHeaders class. + /// + /// URI to poll for asynchronous + /// operation status. + /// URI to poll for asynchronous operation + /// result. + public ComputeDeleteHeaders(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/ComputeInstance.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstance.cs new file mode 100644 index 0000000000000..26f5fd212f9b9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstance.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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Azure Machine Learning compute instance. + /// + public partial class ComputeInstance : Compute + { + /// + /// Initializes a new instance of the ComputeInstance class. + /// + public ComputeInstance() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeInstance class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The time at which the compute was + /// created. + /// The time at which 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. + /// Opt-out of local authentication and + /// ensure customers can use only MSI and AAD exclusively for + /// authentication. + /// Properties of ComputeInstance + public ComputeInstance(string computeLocation = default(string), string provisioningState = default(string), string description = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), string resourceId = default(string), IList provisioningErrors = default(IList), bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), ComputeInstanceProperties properties = default(ComputeInstanceProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute, disableLocalAuth) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets properties of ComputeInstance + /// + [JsonProperty(PropertyName = "properties")] + public ComputeInstanceProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceApplication.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceApplication.cs new file mode 100644 index 0000000000000..be3364ccba8f6 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceApplication.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines an Aml Instance application and its connectivity endpoint URI. + /// + public partial class ComputeInstanceApplication + { + /// + /// Initializes a new instance of the ComputeInstanceApplication class. + /// + public ComputeInstanceApplication() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeInstanceApplication class. + /// + /// Name of the ComputeInstance + /// application. + /// Application' endpoint URI. + public ComputeInstanceApplication(string displayName = default(string), string endpointUri = default(string)) + { + DisplayName = displayName; + EndpointUri = endpointUri; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the ComputeInstance application. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets application' endpoint URI. + /// + [JsonProperty(PropertyName = "endpointUri")] + public string EndpointUri { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceAuthorizationType.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceAuthorizationType.cs new file mode 100644 index 0000000000000..550278a3bf0e0 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceAuthorizationType.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 ComputeInstanceAuthorizationType. + /// + public static class ComputeInstanceAuthorizationType + { + public const string Personal = "personal"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceConnectivityEndpoints.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceConnectivityEndpoints.cs new file mode 100644 index 0000000000000..583e2186462ea --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceConnectivityEndpoints.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines all connectivity endpoints and properties for an + /// ComputeInstance. + /// + public partial class ComputeInstanceConnectivityEndpoints + { + /// + /// Initializes a new instance of the + /// ComputeInstanceConnectivityEndpoints class. + /// + public ComputeInstanceConnectivityEndpoints() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ComputeInstanceConnectivityEndpoints class. + /// + /// Public IP Address of this + /// ComputeInstance. + /// Private IP Address of this + /// ComputeInstance (local to the VNET in which the compute instance is + /// deployed). + public ComputeInstanceConnectivityEndpoints(string publicIpAddress = default(string), string privateIpAddress = default(string)) + { + PublicIpAddress = publicIpAddress; + PrivateIpAddress = privateIpAddress; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets public IP Address of this ComputeInstance. + /// + [JsonProperty(PropertyName = "publicIpAddress")] + public string PublicIpAddress { get; private set; } + + /// + /// Gets private IP Address of this ComputeInstance (local to the VNET + /// in which the compute instance is deployed). + /// + [JsonProperty(PropertyName = "privateIpAddress")] + public string PrivateIpAddress { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceCreatedBy.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceCreatedBy.cs new file mode 100644 index 0000000000000..859860ea27d6c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceCreatedBy.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes information on user who created this ComputeInstance. + /// + public partial class ComputeInstanceCreatedBy + { + /// + /// Initializes a new instance of the ComputeInstanceCreatedBy class. + /// + public ComputeInstanceCreatedBy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeInstanceCreatedBy class. + /// + /// Name of the user. + /// Uniquely identifies user' Azure Active + /// Directory organization. + /// Uniquely identifies the user within his/her + /// organization. + public ComputeInstanceCreatedBy(string userName = default(string), string userOrgId = default(string), string userId = default(string)) + { + UserName = userName; + UserOrgId = userOrgId; + UserId = userId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the user. + /// + [JsonProperty(PropertyName = "userName")] + public string UserName { get; private set; } + + /// + /// Gets uniquely identifies user' Azure Active Directory organization. + /// + [JsonProperty(PropertyName = "userOrgId")] + public string UserOrgId { get; private set; } + + /// + /// Gets uniquely identifies the user within his/her organization. + /// + [JsonProperty(PropertyName = "userId")] + public string UserId { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceLastOperation.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceLastOperation.cs new file mode 100644 index 0000000000000..451934129a220 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceLastOperation.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 last operation on ComputeInstance. + /// + public partial class ComputeInstanceLastOperation + { + /// + /// Initializes a new instance of the ComputeInstanceLastOperation + /// class. + /// + public ComputeInstanceLastOperation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeInstanceLastOperation + /// class. + /// + /// Name of the last operation. Possible + /// values include: 'Create', 'Start', 'Stop', 'Restart', 'Reimage', + /// 'Delete' + /// Time of the last operation. + /// Operation status. Possible values + /// include: 'InProgress', 'Succeeded', 'CreateFailed', 'StartFailed', + /// 'StopFailed', 'RestartFailed', 'ReimageFailed', + /// 'DeleteFailed' + public ComputeInstanceLastOperation(string operationName = default(string), System.DateTime? operationTime = default(System.DateTime?), string operationStatus = default(string)) + { + OperationName = operationName; + OperationTime = operationTime; + OperationStatus = operationStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the last operation. Possible values include: + /// 'Create', 'Start', 'Stop', 'Restart', 'Reimage', 'Delete' + /// + [JsonProperty(PropertyName = "operationName")] + public string OperationName { get; set; } + + /// + /// Gets or sets time of the last operation. + /// + [JsonProperty(PropertyName = "operationTime")] + public System.DateTime? OperationTime { get; set; } + + /// + /// Gets or sets operation status. Possible values include: + /// 'InProgress', 'Succeeded', 'CreateFailed', 'StartFailed', + /// 'StopFailed', 'RestartFailed', 'ReimageFailed', 'DeleteFailed' + /// + [JsonProperty(PropertyName = "operationStatus")] + public string OperationStatus { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceProperties.cs new file mode 100644 index 0000000000000..1f26d8e85ad88 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceProperties.cs @@ -0,0 +1,208 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Compute Instance properties + /// + public partial class ComputeInstanceProperties + { + /// + /// Initializes a new instance of the ComputeInstanceProperties class. + /// + public ComputeInstanceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeInstanceProperties class. + /// + /// Virtual Machine Size + /// Subnet. + /// Sharing policy for + /// applications on this compute instance + /// Specifies policy and settings for SSH + /// access. + /// Describes all connectivity + /// endpoints available for this ComputeInstance. + /// Describes available applications and + /// their endpoints on this ComputeInstance. + /// Describes information on user who created + /// this ComputeInstance. + /// Errors. + /// The current state of this ComputeInstance. + /// Possible values include: 'Creating', 'CreateFailed', 'Deleting', + /// 'Running', 'Restarting', 'JobRunning', 'SettingUp', 'SetupFailed', + /// 'Starting', 'Stopped', 'Stopping', 'UserSettingUp', + /// 'UserSetupFailed', 'Unknown', 'Unusable' + /// Compute Instance + /// Authorization type. + /// Personal Compute + /// Instance settings. + /// Details of customized scripts to execute + /// for setting up the cluster. + /// The last operation on + /// ComputeInstance. + public ComputeInstanceProperties(string vmSize = default(string), ResourceId subnet = default(ResourceId), string applicationSharingPolicy = default(string), ComputeInstanceSshSettings sshSettings = default(ComputeInstanceSshSettings), ComputeInstanceConnectivityEndpoints connectivityEndpoints = default(ComputeInstanceConnectivityEndpoints), IList applications = default(IList), ComputeInstanceCreatedBy createdBy = default(ComputeInstanceCreatedBy), IList errors = default(IList), string state = default(string), string computeInstanceAuthorizationType = default(string), PersonalComputeInstanceSettings personalComputeInstanceSettings = default(PersonalComputeInstanceSettings), SetupScripts setupScripts = default(SetupScripts), ComputeInstanceLastOperation lastOperation = default(ComputeInstanceLastOperation)) + { + VmSize = vmSize; + Subnet = subnet; + ApplicationSharingPolicy = applicationSharingPolicy; + SshSettings = sshSettings; + ConnectivityEndpoints = connectivityEndpoints; + Applications = applications; + CreatedBy = createdBy; + Errors = errors; + State = state; + ComputeInstanceAuthorizationType = computeInstanceAuthorizationType; + PersonalComputeInstanceSettings = personalComputeInstanceSettings; + SetupScripts = setupScripts; + LastOperation = lastOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual Machine Size + /// + [JsonProperty(PropertyName = "vmSize")] + public string VmSize { get; set; } + + /// + /// Gets or sets subnet. + /// + /// + /// Virtual network subnet resource ID the compute nodes belong to. + /// + [JsonProperty(PropertyName = "subnet")] + public ResourceId Subnet { get; set; } + + /// + /// Gets or sets sharing policy for applications on this compute + /// instance + /// + /// + /// Policy for sharing applications on this compute instance among + /// users of parent workspace. If Personal, only the creator can access + /// applications on this compute instance. When Shared, any workspace + /// user can access applications on this instance depending on his/her + /// assigned role. Possible values include: 'Personal', 'Shared' + /// + [JsonProperty(PropertyName = "applicationSharingPolicy")] + public string ApplicationSharingPolicy { get; set; } + + /// + /// Gets or sets specifies policy and settings for SSH access. + /// + [JsonProperty(PropertyName = "sshSettings")] + public ComputeInstanceSshSettings SshSettings { get; set; } + + /// + /// Gets describes all connectivity endpoints available for this + /// ComputeInstance. + /// + [JsonProperty(PropertyName = "connectivityEndpoints")] + public ComputeInstanceConnectivityEndpoints ConnectivityEndpoints { get; private set; } + + /// + /// Gets describes available applications and their endpoints on this + /// ComputeInstance. + /// + [JsonProperty(PropertyName = "applications")] + public IList Applications { get; private set; } + + /// + /// Gets describes information on user who created this + /// ComputeInstance. + /// + [JsonProperty(PropertyName = "createdBy")] + public ComputeInstanceCreatedBy CreatedBy { get; private set; } + + /// + /// Gets errors. + /// + /// + /// Collection of errors encountered on this ComputeInstance. + /// + [JsonProperty(PropertyName = "errors")] + public IList Errors { get; private set; } + + /// + /// Gets the current state of this ComputeInstance. Possible values + /// include: 'Creating', 'CreateFailed', 'Deleting', 'Running', + /// 'Restarting', 'JobRunning', 'SettingUp', 'SetupFailed', 'Starting', + /// 'Stopped', 'Stopping', 'UserSettingUp', 'UserSetupFailed', + /// 'Unknown', 'Unusable' + /// + [JsonProperty(PropertyName = "state")] + public string State { get; private set; } + + /// + /// Gets or sets compute Instance Authorization type. + /// + /// + /// The Compute Instance Authorization type. Available values are + /// personal (default). Possible values include: 'personal' + /// + [JsonProperty(PropertyName = "computeInstanceAuthorizationType")] + public string ComputeInstanceAuthorizationType { get; set; } + + /// + /// Gets or sets personal Compute Instance settings. + /// + /// + /// Settings for a personal compute instance. + /// + [JsonProperty(PropertyName = "personalComputeInstanceSettings")] + public PersonalComputeInstanceSettings PersonalComputeInstanceSettings { get; set; } + + /// + /// Gets or sets details of customized scripts to execute for setting + /// up the cluster. + /// + [JsonProperty(PropertyName = "setupScripts")] + public SetupScripts SetupScripts { get; set; } + + /// + /// Gets the last operation on ComputeInstance. + /// + [JsonProperty(PropertyName = "lastOperation")] + public ComputeInstanceLastOperation LastOperation { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Subnet != null) + { + Subnet.Validate(); + } + if (PersonalComputeInstanceSettings != null) + { + PersonalComputeInstanceSettings.Validate(); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceSshSettings.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceSshSettings.cs new file mode 100644 index 0000000000000..f090886489401 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceSshSettings.cs @@ -0,0 +1,86 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specifies policy and settings for SSH access. + /// + public partial class ComputeInstanceSshSettings + { + /// + /// Initializes a new instance of the ComputeInstanceSshSettings class. + /// + public ComputeInstanceSshSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeInstanceSshSettings class. + /// + /// Access policy for SSH + /// Describes the admin user name. + /// Describes the port for connecting through + /// SSH. + /// Specifies the SSH rsa public key file + /// as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH + /// key pairs. + public ComputeInstanceSshSettings(string sshPublicAccess = default(string), string adminUserName = default(string), int? sshPort = default(int?), string adminPublicKey = default(string)) + { + SshPublicAccess = sshPublicAccess; + AdminUserName = adminUserName; + SshPort = sshPort; + AdminPublicKey = adminPublicKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets access policy for SSH + /// + /// + /// State of the public SSH port. Possible values are: Disabled - + /// Indicates that the public ssh port is closed on this instance. + /// Enabled - Indicates that the public ssh port is open and accessible + /// according to the VNet/subnet policy if applicable. Possible values + /// include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "sshPublicAccess")] + public string SshPublicAccess { get; set; } + + /// + /// Gets describes the admin user name. + /// + [JsonProperty(PropertyName = "adminUserName")] + public string AdminUserName { get; private set; } + + /// + /// Gets describes the port for connecting through SSH. + /// + [JsonProperty(PropertyName = "sshPort")] + public int? SshPort { get; private set; } + + /// + /// Gets or sets specifies the SSH rsa public key file as a string. Use + /// "ssh-keygen -t rsa -b 2048" to generate your SSH key pairs. + /// + [JsonProperty(PropertyName = "adminPublicKey")] + public string AdminPublicKey { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceState.cs new file mode 100644 index 0000000000000..fa0f95bdafb37 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeInstanceState.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for ComputeInstanceState. + /// + public static class ComputeInstanceState + { + public const string Creating = "Creating"; + public const string CreateFailed = "CreateFailed"; + public const string Deleting = "Deleting"; + public const string Running = "Running"; + public const string Restarting = "Restarting"; + public const string JobRunning = "JobRunning"; + public const string SettingUp = "SettingUp"; + public const string SetupFailed = "SetupFailed"; + public const string Starting = "Starting"; + public const string Stopped = "Stopped"; + public const string Stopping = "Stopping"; + public const string UserSettingUp = "UserSettingUp"; + public const string UserSetupFailed = "UserSetupFailed"; + public const string Unknown = "Unknown"; + public const string Unusable = "Unusable"; + } +} 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..afa1ddfc94dd3 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeResource.cs @@ -0,0 +1,102 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.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. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Compute properties + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + /// System data + public ComputeResource(string id = default(string), string name = default(string), string type = default(string), Compute properties = default(Compute), Identity identity = default(Identity), string location = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), SystemData systemData = default(SystemData)) + : base(id, name, type) + { + Properties = properties; + Identity = identity; + Location = location; + Tags = tags; + Sku = sku; + SystemData = systemData; + 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; } + + /// + /// 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 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; } + + /// + /// Gets or sets system data + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeSecrets.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeSecrets.cs new file mode 100644 index 0000000000000..5c33a82a7a802 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeSecrets.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using System.Linq; + + /// + /// Secrets related to a Machine Learning compute. Might differ for every + /// type of compute. + /// + public partial class ComputeSecrets + { + /// + /// Initializes a new instance of the ComputeSecrets class. + /// + public ComputeSecrets() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeType.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeType.cs new file mode 100644 index 0000000000000..d55a7da7aae2f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ComputeType.cs @@ -0,0 +1,30 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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 Kubernetes = "Kubernetes"; + public const string AmlCompute = "AmlCompute"; + public const string ComputeInstance = "ComputeInstance"; + public const string DataFactory = "DataFactory"; + public const string VirtualMachine = "VirtualMachine"; + public const string HDInsight = "HDInsight"; + public const string Databricks = "Databricks"; + public const string DataLakeAnalytics = "DataLakeAnalytics"; + public const string SynapseSpark = "SynapseSpark"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ContainerResourceRequirements.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ContainerResourceRequirements.cs new file mode 100644 index 0000000000000..92356dd93ff06 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ContainerResourceRequirements.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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 requirements for the container (cpu and memory). + /// + public partial class ContainerResourceRequirements + { + /// + /// Initializes a new instance of the ContainerResourceRequirements + /// class. + /// + public ContainerResourceRequirements() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContainerResourceRequirements + /// class. + /// + /// The minimum amount of CPU cores to be used by the + /// container. More info: + /// https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + /// The maximum amount of CPU cores allowed to + /// be used by the container. More info: + /// https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + /// The minimum amount of memory (in GB) to be + /// used by the container. More info: + /// https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + /// The maximum amount of memory (in GB) + /// allowed to be used by the container. More info: + /// https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + /// The number of GPU cores in the container. + /// The number of FPGA PCIE devices exposed to the + /// container. Must be multiple of 2. + public ContainerResourceRequirements(double? cpu = default(double?), double? cpuLimit = default(double?), double? memoryInGB = default(double?), double? memoryInGBLimit = default(double?), int? gpu = default(int?), int? fpga = default(int?)) + { + Cpu = cpu; + CpuLimit = cpuLimit; + MemoryInGB = memoryInGB; + MemoryInGBLimit = memoryInGBLimit; + Gpu = gpu; + Fpga = fpga; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the minimum amount of CPU cores to be used by the + /// container. More info: + /// https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + /// + [JsonProperty(PropertyName = "cpu")] + public double? Cpu { get; set; } + + /// + /// Gets or sets the maximum amount of CPU cores allowed to be used by + /// the container. More info: + /// https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + /// + [JsonProperty(PropertyName = "cpuLimit")] + public double? CpuLimit { get; set; } + + /// + /// Gets or sets the minimum amount of memory (in GB) to be used by the + /// container. More info: + /// https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + /// + [JsonProperty(PropertyName = "memoryInGB")] + public double? MemoryInGB { get; set; } + + /// + /// Gets or sets the maximum amount of memory (in GB) allowed to be + /// used by the container. More info: + /// https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + /// + [JsonProperty(PropertyName = "memoryInGBLimit")] + public double? MemoryInGBLimit { get; set; } + + /// + /// Gets or sets the number of GPU cores in the container. + /// + [JsonProperty(PropertyName = "gpu")] + public int? Gpu { get; set; } + + /// + /// Gets or sets the number of FPGA PCIE devices exposed to the + /// container. Must be multiple of 2. + /// + [JsonProperty(PropertyName = "fpga")] + public int? Fpga { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/CosmosDbSettings.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/CosmosDbSettings.cs new file mode 100644 index 0000000000000..32b656c6b86d4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/CosmosDbSettings.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.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class CosmosDbSettings + { + /// + /// Initializes a new instance of the CosmosDbSettings class. + /// + public CosmosDbSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CosmosDbSettings class. + /// + /// The throughput of the + /// collections in cosmosdb database + public CosmosDbSettings(int? collectionsThroughput = default(int?)) + { + CollectionsThroughput = collectionsThroughput; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the throughput of the collections in cosmosdb database + /// + [JsonProperty(PropertyName = "collectionsThroughput")] + public int? CollectionsThroughput { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/CreatedByType.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/CreatedByType.cs new file mode 100644 index 0000000000000..40cf9377dd8f2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/CreatedByType.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 CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} 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..972bfe1d07541 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataFactory.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A DataFactory compute. + /// + public partial class DataFactory : Compute + { + /// + /// Initializes a new instance of the DataFactory class. + /// + public DataFactory() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFactory class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The time at which the compute was + /// created. + /// The time at which 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. + /// Opt-out of local authentication and + /// ensure customers can use only MSI and AAD exclusively for + /// authentication. + 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?), bool? disableLocalAuth = default(bool?)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute, disableLocalAuth) + { + 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..e70077501bd42 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DataLakeAnalytics.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; + + /// + /// A DataLakeAnalytics compute. + /// + public partial class DataLakeAnalytics : Compute + { + /// + /// Initializes a new instance of the DataLakeAnalytics class. + /// + public DataLakeAnalytics() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataLakeAnalytics class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The time at which the compute was + /// created. + /// The time at which 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. + /// Opt-out of local authentication and + /// ensure customers can use only MSI and AAD exclusively for + /// authentication. + 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?), bool? disableLocalAuth = default(bool?), DataLakeAnalyticsProperties properties = default(DataLakeAnalyticsProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute, disableLocalAuth) + { + 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..8dde59e0ded7f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Databricks.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; + + /// + /// A DataFactory compute. + /// + public partial class Databricks : Compute + { + /// + /// Initializes a new instance of the Databricks class. + /// + public Databricks() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Databricks class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The time at which the compute was + /// created. + /// The time at which 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. + /// Opt-out of local authentication and + /// ensure customers can use only MSI and AAD exclusively for + /// authentication. + 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?), bool? disableLocalAuth = default(bool?), DatabricksProperties properties = default(DatabricksProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute, disableLocalAuth) + { + 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..4593662d7044b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksComputeSecrets.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 Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Secrets related to a Machine Learning compute based on Databricks. + /// + public partial class DatabricksComputeSecrets + { + /// + /// Initializes a new instance of the DatabricksComputeSecrets class. + /// + public DatabricksComputeSecrets() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DatabricksComputeSecrets class. + /// + /// The type of compute. Possible values + /// include: 'AKS', 'Kubernetes', 'AmlCompute', 'ComputeInstance', + /// 'DataFactory', 'VirtualMachine', 'HDInsight', 'Databricks', + /// 'DataLakeAnalytics', 'SynapseSpark' + /// access token for databricks + /// account. + public DatabricksComputeSecrets(string computeType, string databricksAccessToken = default(string)) + { + ComputeType = computeType; + DatabricksAccessToken = databricksAccessToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the type of compute. Possible values include: 'AKS', + /// 'Kubernetes', 'AmlCompute', 'ComputeInstance', 'DataFactory', + /// 'VirtualMachine', 'HDInsight', 'Databricks', 'DataLakeAnalytics', + /// 'SynapseSpark' + /// + [JsonProperty(PropertyName = "computeType")] + public string ComputeType { get; set; } + + /// + /// Gets or sets access token for databricks account. + /// + [JsonProperty(PropertyName = "databricksAccessToken")] + public string DatabricksAccessToken { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ComputeType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ComputeType"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksComputeSecretsProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksComputeSecretsProperties.cs new file mode 100644 index 0000000000000..fab17eaafaed1 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksComputeSecretsProperties.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; + + /// + /// Properties of Databricks Compute Secrets + /// + public partial class DatabricksComputeSecretsProperties + { + /// + /// Initializes a new instance of the + /// DatabricksComputeSecretsProperties class. + /// + public DatabricksComputeSecretsProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DatabricksComputeSecretsProperties class. + /// + /// access token for databricks + /// account. + public DatabricksComputeSecretsProperties(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..f94d8d6d40667 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DatabricksProperties.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; + + /// + /// Properties of Databricks + /// + 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 + /// Workspace Url + public DatabricksProperties(string databricksAccessToken = default(string), string workspaceUrl = default(string)) + { + DatabricksAccessToken = databricksAccessToken; + WorkspaceUrl = workspaceUrl; + 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; } + + /// + /// Gets or sets workspace Url + /// + [JsonProperty(PropertyName = "workspaceUrl")] + public string WorkspaceUrl { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseRequestProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseRequestProperties.cs new file mode 100644 index 0000000000000..feb5897873c8f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseRequestProperties.cs @@ -0,0 +1,124 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class DiagnoseRequestProperties + { + /// + /// Initializes a new instance of the DiagnoseRequestProperties class. + /// + public DiagnoseRequestProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiagnoseRequestProperties class. + /// + /// Setting for diagnosing user defined + /// routing + /// Setting for diagnosing network security + /// group + /// Setting for diagnosing resource + /// lock + /// Setting for diagnosing dns + /// resolution + /// Setting for diagnosing dependent + /// storage account + /// Setting for diagnosing dependent key + /// vault + /// Setting for diagnosing dependent + /// container registry + /// Setting for diagnosing dependent + /// application insights + /// Setting for diagnosing unclassified category + /// of problems + public DiagnoseRequestProperties(IDictionary udr = default(IDictionary), IDictionary nsg = default(IDictionary), IDictionary resourceLock = default(IDictionary), IDictionary dnsResolution = default(IDictionary), IDictionary storageAccount = default(IDictionary), IDictionary keyVault = default(IDictionary), IDictionary containerRegistry = default(IDictionary), IDictionary applicationInsights = default(IDictionary), IDictionary others = default(IDictionary)) + { + Udr = udr; + Nsg = nsg; + ResourceLock = resourceLock; + DnsResolution = dnsResolution; + StorageAccount = storageAccount; + KeyVault = keyVault; + ContainerRegistry = containerRegistry; + ApplicationInsights = applicationInsights; + Others = others; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets setting for diagnosing user defined routing + /// + [JsonProperty(PropertyName = "udr")] + public IDictionary Udr { get; set; } + + /// + /// Gets or sets setting for diagnosing network security group + /// + [JsonProperty(PropertyName = "nsg")] + public IDictionary Nsg { get; set; } + + /// + /// Gets or sets setting for diagnosing resource lock + /// + [JsonProperty(PropertyName = "resourceLock")] + public IDictionary ResourceLock { get; set; } + + /// + /// Gets or sets setting for diagnosing dns resolution + /// + [JsonProperty(PropertyName = "dnsResolution")] + public IDictionary DnsResolution { get; set; } + + /// + /// Gets or sets setting for diagnosing dependent storage account + /// + [JsonProperty(PropertyName = "storageAccount")] + public IDictionary StorageAccount { get; set; } + + /// + /// Gets or sets setting for diagnosing dependent key vault + /// + [JsonProperty(PropertyName = "keyVault")] + public IDictionary KeyVault { get; set; } + + /// + /// Gets or sets setting for diagnosing dependent container registry + /// + [JsonProperty(PropertyName = "containerRegistry")] + public IDictionary ContainerRegistry { get; set; } + + /// + /// Gets or sets setting for diagnosing dependent application insights + /// + [JsonProperty(PropertyName = "applicationInsights")] + public IDictionary ApplicationInsights { get; set; } + + /// + /// Gets or sets setting for diagnosing unclassified category of + /// problems + /// + [JsonProperty(PropertyName = "others")] + public IDictionary Others { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResponseResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResponseResult.cs new file mode 100644 index 0000000000000..96d1d322c61cb --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResponseResult.cs @@ -0,0 +1,46 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class DiagnoseResponseResult + { + /// + /// Initializes a new instance of the DiagnoseResponseResult class. + /// + public DiagnoseResponseResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiagnoseResponseResult class. + /// + public DiagnoseResponseResult(DiagnoseResponseResultValue value = default(DiagnoseResponseResultValue)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "value")] + public DiagnoseResponseResultValue Value { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResponseResultValue.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResponseResultValue.cs new file mode 100644 index 0000000000000..1c4550d400610 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResponseResultValue.cs @@ -0,0 +1,98 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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 DiagnoseResponseResultValue + { + /// + /// Initializes a new instance of the DiagnoseResponseResultValue + /// class. + /// + public DiagnoseResponseResultValue() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiagnoseResponseResultValue + /// class. + /// + public DiagnoseResponseResultValue(IList userDefinedRouteResults = default(IList), IList networkSecurityRuleResults = default(IList), IList resourceLockResults = default(IList), IList dnsResolutionResults = default(IList), IList storageAccountResults = default(IList), IList keyVaultResults = default(IList), IList containerRegistryResults = default(IList), IList applicationInsightsResults = default(IList), IList otherResults = default(IList)) + { + UserDefinedRouteResults = userDefinedRouteResults; + NetworkSecurityRuleResults = networkSecurityRuleResults; + ResourceLockResults = resourceLockResults; + DnsResolutionResults = dnsResolutionResults; + StorageAccountResults = storageAccountResults; + KeyVaultResults = keyVaultResults; + ContainerRegistryResults = containerRegistryResults; + ApplicationInsightsResults = applicationInsightsResults; + OtherResults = otherResults; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "userDefinedRouteResults")] + public IList UserDefinedRouteResults { get; set; } + + /// + /// + [JsonProperty(PropertyName = "networkSecurityRuleResults")] + public IList NetworkSecurityRuleResults { get; set; } + + /// + /// + [JsonProperty(PropertyName = "resourceLockResults")] + public IList ResourceLockResults { get; set; } + + /// + /// + [JsonProperty(PropertyName = "dnsResolutionResults")] + public IList DnsResolutionResults { get; set; } + + /// + /// + [JsonProperty(PropertyName = "storageAccountResults")] + public IList StorageAccountResults { get; set; } + + /// + /// + [JsonProperty(PropertyName = "keyVaultResults")] + public IList KeyVaultResults { get; set; } + + /// + /// + [JsonProperty(PropertyName = "containerRegistryResults")] + public IList ContainerRegistryResults { get; set; } + + /// + /// + [JsonProperty(PropertyName = "applicationInsightsResults")] + public IList ApplicationInsightsResults { get; set; } + + /// + /// + [JsonProperty(PropertyName = "otherResults")] + public IList OtherResults { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResult.cs new file mode 100644 index 0000000000000..a60f8c2d29c25 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResult.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Result of Diagnose + /// + public partial class DiagnoseResult + { + /// + /// Initializes a new instance of the DiagnoseResult class. + /// + public DiagnoseResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiagnoseResult class. + /// + /// Code for workspace setup error + /// Level of workspace setup error. Possible values + /// include: 'Warning', 'Error', 'Information' + /// Message of workspace setup error + public DiagnoseResult(string code = default(string), string level = default(string), string message = default(string)) + { + Code = code; + Level = level; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets code for workspace setup error + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets level of workspace setup error. Possible values include: + /// 'Warning', 'Error', 'Information' + /// + [JsonProperty(PropertyName = "level")] + public string Level { get; private set; } + + /// + /// Gets message of workspace setup error + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResultLevel.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResultLevel.cs new file mode 100644 index 0000000000000..663b9efe16798 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseResultLevel.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 DiagnoseResultLevel. + /// + public static class DiagnoseResultLevel + { + public const string Warning = "Warning"; + public const string Error = "Error"; + public const string Information = "Information"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseWorkspaceParameters.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseWorkspaceParameters.cs new file mode 100644 index 0000000000000..1cfa30ef541a6 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/DiagnoseWorkspaceParameters.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; + + /// + /// Parameters to diagnose a workspace + /// + public partial class DiagnoseWorkspaceParameters + { + /// + /// Initializes a new instance of the DiagnoseWorkspaceParameters + /// class. + /// + public DiagnoseWorkspaceParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiagnoseWorkspaceParameters + /// class. + /// + /// Value of Parameters + public DiagnoseWorkspaceParameters(DiagnoseRequestProperties value = default(DiagnoseRequestProperties)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets value of Parameters + /// + [JsonProperty(PropertyName = "value")] + public DiagnoseRequestProperties Value { 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..c320061c25e8b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EncryptionProperty.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; + + 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. + /// The identity that will be used to access the + /// key vault for encryption at rest. + public EncryptionProperty(string status, KeyVaultProperties keyVaultProperties, IdentityForCmk identity = default(IdentityForCmk)) + { + Status = status; + Identity = identity; + 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 the identity that will be used to access the key vault + /// for encryption at rest. + /// + [JsonProperty(PropertyName = "identity")] + public IdentityForCmk Identity { 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/ErrorAdditionalInfo.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 0000000000000..42982b4887cf0 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorAdditionalInfo.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; + + /// + /// The resource management error additional info. + /// + public partial class ErrorAdditionalInfo + { + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + public ErrorAdditionalInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { + Type = type; + Info = info; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the additional info type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the additional info. + /// + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } + + } +} 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..7c40028e1c311 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} 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..55dfa4c50e70f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ErrorResponse.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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; + + /// + /// Error response + /// + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.). + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; 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/EstimatedVMPrice.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EstimatedVMPrice.cs new file mode 100644 index 0000000000000..999963841b1a8 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EstimatedVMPrice.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 Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The estimated price info for using a VM of a particular OS type, tier, + /// etc. + /// + public partial class EstimatedVMPrice + { + /// + /// Initializes a new instance of the EstimatedVMPrice class. + /// + public EstimatedVMPrice() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EstimatedVMPrice class. + /// + /// Retail price + /// OS type + /// VM tier + public EstimatedVMPrice(double retailPrice, string osType, string vmTier) + { + RetailPrice = retailPrice; + OsType = osType; + VmTier = vmTier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets retail price + /// + /// + /// The price charged for using the VM. + /// + [JsonProperty(PropertyName = "retailPrice")] + public double RetailPrice { get; set; } + + /// + /// Gets or sets OS type + /// + /// + /// Operating system type used by the VM. Possible values include: + /// 'Linux', 'Windows' + /// + [JsonProperty(PropertyName = "osType")] + public string OsType { get; set; } + + /// + /// Gets or sets VM tier + /// + /// + /// The type of the VM. Possible values include: 'Standard', + /// 'LowPriority', 'Spot' + /// + [JsonProperty(PropertyName = "vmTier")] + public string VmTier { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (OsType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "OsType"); + } + if (VmTier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VmTier"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EstimatedVMPrices.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EstimatedVMPrices.cs new file mode 100644 index 0000000000000..98fe97c833975 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/EstimatedVMPrices.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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; + + /// + /// The estimated price info for using a VM. + /// + public partial class EstimatedVMPrices + { + /// + /// Initializes a new instance of the EstimatedVMPrices class. + /// + public EstimatedVMPrices() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EstimatedVMPrices class. + /// + /// List of estimated VM prices. + public EstimatedVMPrices(IList values) + { + Values = values; + CustomInit(); + } + /// + /// Static constructor for EstimatedVMPrices class. + /// + static EstimatedVMPrices() + { + BillingCurrency = "USD"; + UnitOfMeasure = "OneHour"; + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of estimated VM prices. + /// + /// + /// The list of estimated prices for using a VM of a particular OS + /// type, tier, etc. + /// + [JsonProperty(PropertyName = "values")] + public IList Values { get; set; } + + /// + /// Three lettered code specifying the currency of the VM price. + /// Example: USD + /// + [JsonProperty(PropertyName = "billingCurrency")] + public static string BillingCurrency { get; private set; } + + /// + /// The unit of time measurement for the specified VM price. Example: + /// OneHour + /// + [JsonProperty(PropertyName = "unitOfMeasure")] + public static string UnitOfMeasure { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Values == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Values"); + } + if (Values != null) + { + foreach (var element in Values) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ExternalFQDNResponse.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ExternalFQDNResponse.cs new file mode 100644 index 0000000000000..de8729db3a89c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ExternalFQDNResponse.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.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class ExternalFQDNResponse + { + /// + /// Initializes a new instance of the ExternalFQDNResponse class. + /// + public ExternalFQDNResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExternalFQDNResponse class. + /// + public ExternalFQDNResponse(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpoint.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpoint.cs new file mode 100644 index 0000000000000..73299a3aa68a2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpoint.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.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class FQDNEndpoint + { + /// + /// Initializes a new instance of the FQDNEndpoint class. + /// + public FQDNEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FQDNEndpoint class. + /// + public FQDNEndpoint(string domainName = default(string), IList endpointDetails = default(IList)) + { + DomainName = domainName; + EndpointDetails = endpointDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "domainName")] + public string DomainName { get; set; } + + /// + /// + [JsonProperty(PropertyName = "endpointDetails")] + public IList EndpointDetails { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpointDetail.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpointDetail.cs new file mode 100644 index 0000000000000..45be3701aeebd --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpointDetail.cs @@ -0,0 +1,46 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class FQDNEndpointDetail + { + /// + /// Initializes a new instance of the FQDNEndpointDetail class. + /// + public FQDNEndpointDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FQDNEndpointDetail class. + /// + public FQDNEndpointDetail(int? port = default(int?)) + { + Port = port; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "port")] + public int? Port { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpoints.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpoints.cs new file mode 100644 index 0000000000000..8a278863c3696 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpoints.cs @@ -0,0 +1,46 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class FQDNEndpoints + { + /// + /// Initializes a new instance of the FQDNEndpoints class. + /// + public FQDNEndpoints() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FQDNEndpoints class. + /// + public FQDNEndpoints(FQDNEndpointsProperties properties = default(FQDNEndpointsProperties)) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public FQDNEndpointsProperties Properties { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpointsProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpointsProperties.cs new file mode 100644 index 0000000000000..e6c7163d11b03 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/FQDNEndpointsProperties.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.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class FQDNEndpointsProperties + { + /// + /// Initializes a new instance of the FQDNEndpointsProperties class. + /// + public FQDNEndpointsProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FQDNEndpointsProperties class. + /// + public FQDNEndpointsProperties(string category = default(string), IList endpoints = default(IList)) + { + Category = category; + Endpoints = endpoints; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// + [JsonProperty(PropertyName = "endpoints")] + public IList Endpoints { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsight.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsight.cs new file mode 100644 index 0000000000000..6bcd38a8b8e81 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsight.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; + + /// + /// A HDInsight compute. + /// + public partial class HDInsight : Compute + { + /// + /// Initializes a new instance of the HDInsight class. + /// + public HDInsight() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HDInsight class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The time at which the compute was + /// created. + /// The time at which 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. + /// Opt-out of local authentication and + /// ensure customers can use only MSI and AAD exclusively for + /// authentication. + 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?), bool? disableLocalAuth = default(bool?), HDInsightProperties properties = default(HDInsightProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute, disableLocalAuth) + { + 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..0f0e42c52c245 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/HDInsightProperties.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.Linq; + + /// + /// HDInsight compute properties + /// + 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..edcbb9e6ac713 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Identity.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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 principal ID of resource + /// identity. + /// The tenant ID of resource. + /// The identity type. Possible values include: + /// 'SystemAssigned', 'SystemAssigned,UserAssigned', 'UserAssigned', + /// 'None' + /// The user assigned identities + /// associated with the resource. + public Identity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), 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', 'SystemAssigned,UserAssigned', 'UserAssigned', + /// 'None' + /// + [JsonProperty(PropertyName = "type")] + public ResourceIdentityType? Type { get; set; } + + /// + /// Gets or sets the user assigned identities associated with the + /// resource. + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/IdentityForCmk.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/IdentityForCmk.cs new file mode 100644 index 0000000000000..09f9de4a2c134 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/IdentityForCmk.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; + + /// + /// Identity that will be used to access key vault for encryption at rest + /// + public partial class IdentityForCmk + { + /// + /// Initializes a new instance of the IdentityForCmk class. + /// + public IdentityForCmk() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IdentityForCmk class. + /// + /// The ArmId of the user assigned + /// identity that will be used to access the customer managed key + /// vault + public IdentityForCmk(string userAssignedIdentity = default(string)) + { + UserAssignedIdentity = userAssignedIdentity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ArmId of the user assigned identity that will be + /// used to access the customer managed key vault + /// + [JsonProperty(PropertyName = "userAssignedIdentity")] + public string UserAssignedIdentity { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/InstanceTypeSchema.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/InstanceTypeSchema.cs new file mode 100644 index 0000000000000..7ff200f2feb6b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/InstanceTypeSchema.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; + + /// + /// Instance type schema. + /// + public partial class InstanceTypeSchema + { + /// + /// Initializes a new instance of the InstanceTypeSchema class. + /// + public InstanceTypeSchema() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InstanceTypeSchema class. + /// + /// Node Selector + /// Resource requests/limits for this instance + /// type + public InstanceTypeSchema(IDictionary nodeSelector = default(IDictionary), InstanceTypeSchemaResources resources = default(InstanceTypeSchemaResources)) + { + NodeSelector = nodeSelector; + Resources = resources; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets node Selector + /// + [JsonProperty(PropertyName = "nodeSelector")] + public IDictionary NodeSelector { get; set; } + + /// + /// Gets or sets resource requests/limits for this instance type + /// + [JsonProperty(PropertyName = "resources")] + public InstanceTypeSchemaResources Resources { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/InstanceTypeSchemaResources.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/InstanceTypeSchemaResources.cs new file mode 100644 index 0000000000000..e2e69ac69338d --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/InstanceTypeSchemaResources.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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Resource requests/limits for this instance type + /// + public partial class InstanceTypeSchemaResources + { + /// + /// Initializes a new instance of the InstanceTypeSchemaResources + /// class. + /// + public InstanceTypeSchemaResources() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InstanceTypeSchemaResources + /// class. + /// + /// Resource requests for this instance + /// type + /// Resource limits for this instance type + public InstanceTypeSchemaResources(IDictionary requests = default(IDictionary), IDictionary limits = default(IDictionary)) + { + Requests = requests; + Limits = limits; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource requests for this instance type + /// + [JsonProperty(PropertyName = "requests")] + public IDictionary Requests { get; set; } + + /// + /// Gets or sets resource limits for this instance type + /// + [JsonProperty(PropertyName = "limits")] + public IDictionary Limits { get; 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/Kubernetes.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Kubernetes.cs new file mode 100644 index 0000000000000..21858af56d12a --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Kubernetes.cs @@ -0,0 +1,171 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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; + + /// + /// A Machine Learning compute based on Kubernetes Compute. + /// + public partial class Kubernetes + { + /// + /// Initializes a new instance of the Kubernetes class. + /// + public Kubernetes() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Kubernetes class. + /// + /// The type of compute. Possible values + /// include: 'AKS', 'Kubernetes', 'AmlCompute', 'ComputeInstance', + /// 'DataFactory', 'VirtualMachine', 'HDInsight', 'Databricks', + /// 'DataLakeAnalytics', 'SynapseSpark' + /// 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 time at which the compute was + /// created. + /// The time at which 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. + /// Opt-out of local authentication and + /// ensure customers can use only MSI and AAD exclusively for + /// authentication. + /// Properties of Kubernetes + public Kubernetes(string computeType, 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?), bool? disableLocalAuth = default(bool?), KubernetesProperties properties = default(KubernetesProperties)) + { + ComputeType = computeType; + ComputeLocation = computeLocation; + ProvisioningState = provisioningState; + Description = description; + CreatedOn = createdOn; + ModifiedOn = modifiedOn; + ResourceId = resourceId; + ProvisioningErrors = provisioningErrors; + IsAttachedCompute = isAttachedCompute; + DisableLocalAuth = disableLocalAuth; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the type of compute. Possible values include: 'AKS', + /// 'Kubernetes', 'AmlCompute', 'ComputeInstance', 'DataFactory', + /// 'VirtualMachine', 'HDInsight', 'Databricks', 'DataLakeAnalytics', + /// 'SynapseSpark' + /// + [JsonProperty(PropertyName = "computeType")] + public string ComputeType { get; set; } + + /// + /// 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 time at which the compute was created. + /// + [JsonProperty(PropertyName = "createdOn")] + public System.DateTime? CreatedOn { get; private set; } + + /// + /// Gets the time at which 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; } + + /// + /// Gets or sets opt-out of local authentication and ensure customers + /// can use only MSI and AAD exclusively for authentication. + /// + [JsonProperty(PropertyName = "disableLocalAuth")] + public bool? DisableLocalAuth { get; set; } + + /// + /// Gets or sets properties of Kubernetes + /// + [JsonProperty(PropertyName = "properties")] + public KubernetesProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ComputeType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ComputeType"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KubernetesProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KubernetesProperties.cs new file mode 100644 index 0000000000000..0e7c52bdbe42f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KubernetesProperties.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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Kubernetes properties + /// + public partial class KubernetesProperties + { + /// + /// Initializes a new instance of the KubernetesProperties class. + /// + public KubernetesProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KubernetesProperties class. + /// + /// Relay connection + /// string. + /// ServiceBus connection + /// string. + /// Extension principal-id. + /// Extension instance + /// release train. + /// VC name. + /// Compute namespace + /// Default instance type + /// Instance Type Schema + public KubernetesProperties(string relayConnectionString = default(string), string serviceBusConnectionString = default(string), string extensionPrincipalId = default(string), string extensionInstanceReleaseTrain = default(string), string vcName = default(string), string namespaceProperty = default(string), string defaultInstanceType = default(string), IDictionary instanceTypes = default(IDictionary)) + { + RelayConnectionString = relayConnectionString; + ServiceBusConnectionString = serviceBusConnectionString; + ExtensionPrincipalId = extensionPrincipalId; + ExtensionInstanceReleaseTrain = extensionInstanceReleaseTrain; + VcName = vcName; + NamespaceProperty = namespaceProperty; + DefaultInstanceType = defaultInstanceType; + InstanceTypes = instanceTypes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets relay connection string. + /// + [JsonProperty(PropertyName = "relayConnectionString")] + public string RelayConnectionString { get; set; } + + /// + /// Gets or sets serviceBus connection string. + /// + [JsonProperty(PropertyName = "serviceBusConnectionString")] + public string ServiceBusConnectionString { get; set; } + + /// + /// Gets or sets extension principal-id. + /// + [JsonProperty(PropertyName = "extensionPrincipalId")] + public string ExtensionPrincipalId { get; set; } + + /// + /// Gets or sets extension instance release train. + /// + [JsonProperty(PropertyName = "extensionInstanceReleaseTrain")] + public string ExtensionInstanceReleaseTrain { get; set; } + + /// + /// Gets or sets VC name. + /// + [JsonProperty(PropertyName = "vcName")] + public string VcName { get; set; } + + /// + /// Gets or sets compute namespace + /// + [JsonProperty(PropertyName = "namespace")] + public string NamespaceProperty { get; set; } + + /// + /// Gets or sets default instance type + /// + [JsonProperty(PropertyName = "defaultInstanceType")] + public string DefaultInstanceType { get; set; } + + /// + /// Gets or sets instance Type Schema + /// + [JsonProperty(PropertyName = "instanceTypes")] + public IDictionary InstanceTypes { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KubernetesSchema.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KubernetesSchema.cs new file mode 100644 index 0000000000000..ed89961147117 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/KubernetesSchema.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; + + /// + /// Kubernetes Compute Schema + /// + public partial class KubernetesSchema + { + /// + /// Initializes a new instance of the KubernetesSchema class. + /// + public KubernetesSchema() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KubernetesSchema class. + /// + /// Properties of Kubernetes + public KubernetesSchema(KubernetesProperties properties = default(KubernetesProperties)) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets properties of Kubernetes + /// + [JsonProperty(PropertyName = "properties")] + public KubernetesProperties Properties { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListNotebookKeysResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListNotebookKeysResult.cs new file mode 100644 index 0000000000000..b8d5558e2cb8a --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListNotebookKeysResult.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 ListNotebookKeysResult + { + /// + /// Initializes a new instance of the ListNotebookKeysResult class. + /// + public ListNotebookKeysResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ListNotebookKeysResult class. + /// + public ListNotebookKeysResult(string primaryAccessKey = default(string), string secondaryAccessKey = default(string)) + { + PrimaryAccessKey = primaryAccessKey; + SecondaryAccessKey = secondaryAccessKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "primaryAccessKey")] + public string PrimaryAccessKey { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "secondaryAccessKey")] + public string SecondaryAccessKey { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListStorageAccountKeysResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListStorageAccountKeysResult.cs new file mode 100644 index 0000000000000..3ad9d4feaad9c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListStorageAccountKeysResult.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 ListStorageAccountKeysResult + { + /// + /// Initializes a new instance of the ListStorageAccountKeysResult + /// class. + /// + public ListStorageAccountKeysResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ListStorageAccountKeysResult + /// class. + /// + public ListStorageAccountKeysResult(string userStorageKey = default(string)) + { + UserStorageKey = userStorageKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "userStorageKey")] + public string UserStorageKey { get; private set; } + + } +} 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..c1afaaa764dc7 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ListWorkspaceKeysResult.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ListWorkspaceKeysResult + { + /// + /// Initializes a new instance of the ListWorkspaceKeysResult class. + /// + public ListWorkspaceKeysResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ListWorkspaceKeysResult class. + /// + public ListWorkspaceKeysResult(string userStorageKey = default(string), string userStorageResourceId = default(string), string appInsightsInstrumentationKey = default(string), RegistryListCredentialsResult containerRegistryCredentials = default(RegistryListCredentialsResult), ListNotebookKeysResult notebookAccessKeys = default(ListNotebookKeysResult)) + { + UserStorageKey = userStorageKey; + UserStorageResourceId = userStorageResourceId; + AppInsightsInstrumentationKey = appInsightsInstrumentationKey; + ContainerRegistryCredentials = containerRegistryCredentials; + NotebookAccessKeys = notebookAccessKeys; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "userStorageKey")] + public string UserStorageKey { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "userStorageResourceId")] + public string UserStorageResourceId { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "appInsightsInstrumentationKey")] + public string AppInsightsInstrumentationKey { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "containerRegistryCredentials")] + public RegistryListCredentialsResult ContainerRegistryCredentials { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "notebookAccessKeys")] + public ListNotebookKeysResult NotebookAccessKeys { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/LoadBalancerType.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/LoadBalancerType.cs new file mode 100644 index 0000000000000..20a1c9c0e1b71 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/LoadBalancerType.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 LoadBalancerType. + /// + public static class LoadBalancerType + { + public const string PublicIp = "PublicIp"; + public const string InternalLoadBalancer = "InternalLoadBalancer"; + } +} 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/NotebookAccessTokenResult.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookAccessTokenResult.cs new file mode 100644 index 0000000000000..e6c71ff96fdf9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookAccessTokenResult.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; + + public partial class NotebookAccessTokenResult + { + /// + /// Initializes a new instance of the NotebookAccessTokenResult class. + /// + public NotebookAccessTokenResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotebookAccessTokenResult class. + /// + public NotebookAccessTokenResult(string notebookResourceId = default(string), string hostName = default(string), string publicDns = default(string), string accessToken = default(string), string tokenType = default(string), int? expiresIn = default(int?), string refreshToken = default(string), string scope = default(string)) + { + NotebookResourceId = notebookResourceId; + HostName = hostName; + PublicDns = publicDns; + AccessToken = accessToken; + TokenType = tokenType; + ExpiresIn = expiresIn; + RefreshToken = refreshToken; + Scope = scope; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "notebookResourceId")] + public string NotebookResourceId { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "hostName")] + public string HostName { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "publicDns")] + public string PublicDns { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "accessToken")] + public string AccessToken { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "tokenType")] + public string TokenType { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "expiresIn")] + public int? ExpiresIn { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "refreshToken")] + public string RefreshToken { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "scope")] + public string Scope { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookPreparationError.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookPreparationError.cs new file mode 100644 index 0000000000000..35182f23db9b1 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookPreparationError.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class NotebookPreparationError + { + /// + /// Initializes a new instance of the NotebookPreparationError class. + /// + public NotebookPreparationError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotebookPreparationError class. + /// + public NotebookPreparationError(string errorMessage = default(string), int? statusCode = default(int?)) + { + ErrorMessage = errorMessage; + StatusCode = statusCode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage { get; set; } + + /// + /// + [JsonProperty(PropertyName = "statusCode")] + public int? StatusCode { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookResourceInfo.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookResourceInfo.cs new file mode 100644 index 0000000000000..cc95f0ae282b9 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/NotebookResourceInfo.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class NotebookResourceInfo + { + /// + /// Initializes a new instance of the NotebookResourceInfo class. + /// + public NotebookResourceInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotebookResourceInfo class. + /// + /// the data plane resourceId that used to + /// initialize notebook component + /// The error that occurs when + /// preparing notebook. + public NotebookResourceInfo(string fqdn = default(string), string resourceId = default(string), NotebookPreparationError notebookPreparationError = default(NotebookPreparationError)) + { + Fqdn = fqdn; + ResourceId = resourceId; + NotebookPreparationError = notebookPreparationError; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "fqdn")] + public string Fqdn { get; set; } + + /// + /// Gets or sets the data plane resourceId that used to initialize + /// notebook component + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets or sets the error that occurs when preparing notebook. + /// + [JsonProperty(PropertyName = "notebookPreparationError")] + public NotebookPreparationError NotebookPreparationError { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Operation.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Operation.cs new file mode 100644 index 0000000000000..de68889311e6e --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Operation.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure Machine Learning workspace REST API operation + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// Operation name: + /// {provider}/{resource}/{operation} + /// Display name of operation + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets operation name: {provider}/{resource}/{operation} + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets display name of operation + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationDisplay.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 0000000000000..c7936af142fc5 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationDisplay.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Display name of operation + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// The resource provider name: + /// Microsoft.MachineLearningExperimentation + /// The resource on which the operation is + /// performed. + /// The operation that users can + /// perform. + /// The description for the + /// operation. + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource provider name: + /// Microsoft.MachineLearningExperimentation + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets the resource on which the operation is performed. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + /// + /// Gets or sets the operation that users can perform. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets the description for the operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationName.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationName.cs new file mode 100644 index 0000000000000..b1fcfaa4e89e4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationName.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 OperationName. + /// + public static class OperationName + { + public const string Create = "Create"; + public const string Start = "Start"; + public const string Stop = "Stop"; + public const string Restart = "Restart"; + public const string Reimage = "Reimage"; + public const string Delete = "Delete"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationStatus.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationStatus.cs new file mode 100644 index 0000000000000..9d1e82d7c7379 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OperationStatus.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 OperationStatus. + /// + public static class OperationStatus + { + public const string InProgress = "InProgress"; + public const string Succeeded = "Succeeded"; + public const string CreateFailed = "CreateFailed"; + public const string StartFailed = "StartFailed"; + public const string StopFailed = "StopFailed"; + public const string RestartFailed = "RestartFailed"; + public const string ReimageFailed = "ReimageFailed"; + public const string DeleteFailed = "DeleteFailed"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OsType.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OsType.cs new file mode 100644 index 0000000000000..a3d4e9722bb8b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/OsType.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 OsType. + /// + public static class OsType + { + public const string Linux = "Linux"; + public const string Windows = "Windows"; + } +} 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/Page2.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page2.cs new file mode 100644 index 0000000000000..7615fcadf932d --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Page2.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 Page2 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("nodes")] + 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/PersonalComputeInstanceSettings.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PersonalComputeInstanceSettings.cs new file mode 100644 index 0000000000000..230f1def54bac --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PersonalComputeInstanceSettings.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Settings for a personal compute instance. + /// + public partial class PersonalComputeInstanceSettings + { + /// + /// Initializes a new instance of the PersonalComputeInstanceSettings + /// class. + /// + public PersonalComputeInstanceSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PersonalComputeInstanceSettings + /// class. + /// + /// Assigned User. + public PersonalComputeInstanceSettings(AssignedUser assignedUser = default(AssignedUser)) + { + AssignedUser = assignedUser; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets assigned User. + /// + /// + /// A user explicitly assigned to a personal compute instance. + /// + [JsonProperty(PropertyName = "assignedUser")] + public AssignedUser AssignedUser { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AssignedUser != null) + { + AssignedUser.Validate(); + } + } + } +} 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..1b7a6f44d6083 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpoint.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.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 + /// The ARM identifier for Subnet resource + /// that private endpoint links to + public PrivateEndpoint(string id = default(string), string subnetArmId = default(string)) + { + Id = id; + SubnetArmId = subnetArmId; + 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; } + + /// + /// Gets the ARM identifier for Subnet resource that private endpoint + /// links to + /// + [JsonProperty(PropertyName = "subnetArmId")] + public string SubnetArmId { 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..2833d5513374f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnection.cs @@ -0,0 +1,142 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.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. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The resource of private end + /// point. + /// The provisioning state of the + /// private endpoint connection resource. Possible values include: + /// 'Succeeded', 'Creating', 'Deleting', 'Failed' + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + /// System data + public PrivateEndpointConnection(PrivateLinkServiceConnectionState privateLinkServiceConnectionState, string id = default(string), string name = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), string provisioningState = default(string), Identity identity = default(Identity), string location = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), SystemData systemData = default(SystemData)) + : base(id, name, type) + { + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + ProvisioningState = provisioningState; + Identity = identity; + Location = location; + Tags = tags; + Sku = sku; + SystemData = systemData; + 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; } + + /// + /// 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 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; } + + /// + /// Gets or sets system data + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrivateLinkServiceConnectionState == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PrivateLinkServiceConnectionState"); + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 0000000000000..e5c43266e2286 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for PrivateEndpointConnectionProvisioningState. + /// + public static class PrivateEndpointConnectionProvisioningState + { + public const string Succeeded = "Succeeded"; + public const string Creating = "Creating"; + public const string Deleting = "Deleting"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 0000000000000..fd8a93df2042c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for PrivateEndpointServiceConnectionStatus. + /// + public static class PrivateEndpointServiceConnectionStatus + { + public const string Pending = "Pending"; + public const string Approved = "Approved"; + public const string Rejected = "Rejected"; + public const string Disconnected = "Disconnected"; + public const string Timeout = "Timeout"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResource.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResource.cs new file mode 100644 index 0000000000000..4533e04f37dd1 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PrivateLinkResource.cs @@ -0,0 +1,123 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The private link resource group id. + /// The private link resource required + /// member names. + /// The private link resource Private + /// link DNS zone name. + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + /// System data + public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList), Identity identity = default(Identity), string location = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), SystemData systemData = default(SystemData)) + : base(id, name, type) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + Identity = identity; + Location = location; + Tags = tags; + Sku = sku; + SystemData = systemData; + 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; } + + /// + /// 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 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; } + + /// + /// Gets or sets system data + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; set; } + + } +} 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/ProxyResource.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ProxyResource.cs new file mode 100644 index 0000000000000..4719bd9bddb12 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ProxyResource.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 System.Linq; + + /// + /// Proxy Resource + /// + /// + /// The resource model definition for a Azure Resource Manager proxy + /// resource. It will not have tags and a location + /// + public partial class ProxyResource : Resource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + 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/PublicNetworkAccess.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PublicNetworkAccess.cs new file mode 100644 index 0000000000000..0f1058eb25add --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/PublicNetworkAccess.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 PublicNetworkAccess. + /// + public static class PublicNetworkAccess + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} 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..88462d4c3f96f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/QuotaUpdateParameters.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; + + /// + /// 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. + /// Region of workspace quota to be + /// updated. + public QuotaUpdateParameters(IList value = default(IList), string location = default(string)) + { + Value = value; + Location = location; + 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; } + + /// + /// Gets or sets region of workspace quota to be updated. + /// + [JsonProperty(PropertyName = "location")] + public string Location { 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..a4e2a535166ad --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Resource.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 Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Resource + /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + public Resource(string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} 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..9da209c2cf6be --- /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 = "SystemAssigned,UserAssigned")] + SystemAssignedUserAssigned, + [EnumMember(Value = "UserAssigned")] + UserAssigned, + [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.SystemAssignedUserAssigned: + return "SystemAssigned,UserAssigned"; + case ResourceIdentityType.UserAssigned: + return "UserAssigned"; + case ResourceIdentityType.None: + return "None"; + } + return null; + } + + internal static ResourceIdentityType? ParseResourceIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return ResourceIdentityType.SystemAssigned; + case "SystemAssigned,UserAssigned": + return ResourceIdentityType.SystemAssignedUserAssigned; + case "UserAssigned": + return ResourceIdentityType.UserAssigned; + 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..72121dfb2b246 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ResourceQuota.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.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. + /// Region of the AML workspace in + /// the 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 amlWorkspaceLocation = default(string), string type = default(string), ResourceName name = default(ResourceName), long? limit = default(long?), string unit = default(string)) + { + Id = id; + AmlWorkspaceLocation = amlWorkspaceLocation; + 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 region of the AML workspace in the id. + /// + [JsonProperty(PropertyName = "amlWorkspaceLocation")] + public string AmlWorkspaceLocation { 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..58158d8886915 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScaleSettings.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; + + /// + /// 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. This string needs to be in the RFC + /// Format. + 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. This + /// string needs to be in the RFC Format. + /// + [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/ScaleSettingsInformation.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScaleSettingsInformation.cs new file mode 100644 index 0000000000000..131b0209a4cae --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScaleSettingsInformation.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; + + /// + /// Desired scale settings for the amlCompute. + /// + public partial class ScaleSettingsInformation + { + /// + /// Initializes a new instance of the ScaleSettingsInformation class. + /// + public ScaleSettingsInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScaleSettingsInformation class. + /// + /// Scale settings. + public ScaleSettingsInformation(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. + /// + [JsonProperty(PropertyName = "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/ScriptReference.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScriptReference.cs new file mode 100644 index 0000000000000..4470a70e21ea8 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScriptReference.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; + + /// + /// Script reference + /// + public partial class ScriptReference + { + /// + /// Initializes a new instance of the ScriptReference class. + /// + public ScriptReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScriptReference class. + /// + /// The storage source of the script: + /// inline, workspace. + /// The location of scripts in the mounted + /// volume. + /// Optional command line arguments + /// passed to the script to run. + /// Optional time period passed to timeout + /// command. + public ScriptReference(string scriptSource = default(string), string scriptData = default(string), string scriptArguments = default(string), string timeout = default(string)) + { + ScriptSource = scriptSource; + ScriptData = scriptData; + ScriptArguments = scriptArguments; + Timeout = timeout; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the storage source of the script: inline, workspace. + /// + [JsonProperty(PropertyName = "scriptSource")] + public string ScriptSource { get; set; } + + /// + /// Gets or sets the location of scripts in the mounted volume. + /// + [JsonProperty(PropertyName = "scriptData")] + public string ScriptData { get; set; } + + /// + /// Gets or sets optional command line arguments passed to the script + /// to run. + /// + [JsonProperty(PropertyName = "scriptArguments")] + public string ScriptArguments { get; set; } + + /// + /// Gets or sets optional time period passed to timeout command. + /// + [JsonProperty(PropertyName = "timeout")] + public string Timeout { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScriptsToExecute.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScriptsToExecute.cs new file mode 100644 index 0000000000000..33905c9d7ef36 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ScriptsToExecute.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.Linq; + + /// + /// Customized setup scripts + /// + public partial class ScriptsToExecute + { + /// + /// Initializes a new instance of the ScriptsToExecute class. + /// + public ScriptsToExecute() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScriptsToExecute class. + /// + /// Script that's run every time the + /// machine starts. + /// Script that's run only once during + /// provision of the compute. + public ScriptsToExecute(ScriptReference startupScript = default(ScriptReference), ScriptReference creationScript = default(ScriptReference)) + { + StartupScript = startupScript; + CreationScript = creationScript; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets script that's run every time the machine starts. + /// + [JsonProperty(PropertyName = "startupScript")] + public ScriptReference StartupScript { get; set; } + + /// + /// Gets or sets script that's run only once during provision of the + /// compute. + /// + [JsonProperty(PropertyName = "creationScript")] + public ScriptReference CreationScript { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ServiceManagedResourcesSettings.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ServiceManagedResourcesSettings.cs new file mode 100644 index 0000000000000..74230b0c880ee --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ServiceManagedResourcesSettings.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 ServiceManagedResourcesSettings + { + /// + /// Initializes a new instance of the ServiceManagedResourcesSettings + /// class. + /// + public ServiceManagedResourcesSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceManagedResourcesSettings + /// class. + /// + /// The settings for the service managed + /// cosmosdb account. + public ServiceManagedResourcesSettings(CosmosDbSettings cosmosDb = default(CosmosDbSettings)) + { + CosmosDb = cosmosDb; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the settings for the service managed cosmosdb account. + /// + [JsonProperty(PropertyName = "cosmosDb")] + public CosmosDbSettings CosmosDb { get; set; } + + } +} 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/SetupScripts.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SetupScripts.cs new file mode 100644 index 0000000000000..d1e704506a8a1 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SetupScripts.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; + + /// + /// Details of customized scripts to execute for setting up the cluster. + /// + public partial class SetupScripts + { + /// + /// Initializes a new instance of the SetupScripts class. + /// + public SetupScripts() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SetupScripts class. + /// + /// Customized setup scripts + public SetupScripts(ScriptsToExecute scripts = default(ScriptsToExecute)) + { + Scripts = scripts; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets customized setup scripts + /// + [JsonProperty(PropertyName = "scripts")] + public ScriptsToExecute Scripts { get; set; } + + } +} 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/SshPublicAccess.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SshPublicAccess.cs new file mode 100644 index 0000000000000..f90cf17a41804 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SshPublicAccess.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + + /// + /// Defines values for SshPublicAccess. + /// + public static class SshPublicAccess + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SslConfiguration.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SslConfiguration.cs new file mode 100644 index 0000000000000..c86702a6e866d --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SslConfiguration.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 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', 'Auto' + /// Cert data + /// Key data + /// CNAME of the cert + /// Leaf domain label of public + /// endpoint + /// Indicates whether to + /// overwrite existing domain label. + public SslConfiguration(string status = default(string), string cert = default(string), string key = default(string), string cname = default(string), string leafDomainLabel = default(string), bool? overwriteExistingDomain = default(bool?)) + { + Status = status; + Cert = cert; + Key = key; + Cname = cname; + LeafDomainLabel = leafDomainLabel; + OverwriteExistingDomain = overwriteExistingDomain; + 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', 'Auto' + /// + [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; } + + /// + /// Gets or sets leaf domain label of public endpoint + /// + [JsonProperty(PropertyName = "leafDomainLabel")] + public string LeafDomainLabel { get; set; } + + /// + /// Gets or sets indicates whether to overwrite existing domain label. + /// + [JsonProperty(PropertyName = "overwriteExistingDomain")] + public bool? OverwriteExistingDomain { 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/SynapseSpark.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SynapseSpark.cs new file mode 100644 index 0000000000000..41f18fbba0621 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SynapseSpark.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; + + /// + /// A SynapseSpark compute. + /// + public partial class SynapseSpark : Compute + { + /// + /// Initializes a new instance of the SynapseSpark class. + /// + public SynapseSpark() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SynapseSpark 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 time at which the compute was + /// created. + /// The time at which 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. + /// Opt-out of local authentication and + /// ensure customers can use only MSI and AAD exclusively for + /// authentication. + public SynapseSpark(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?), bool? disableLocalAuth = default(bool?), SynapseSparkProperties properties = default(SynapseSparkProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute, disableLocalAuth) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public SynapseSparkProperties Properties { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SynapseSparkProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SynapseSparkProperties.cs new file mode 100644 index 0000000000000..9adf5141052e4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SynapseSparkProperties.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.Linq; + + public partial class SynapseSparkProperties + { + /// + /// Initializes a new instance of the SynapseSparkProperties class. + /// + public SynapseSparkProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SynapseSparkProperties class. + /// + /// Auto scale properties. + /// Auto pause properties. + /// Spark version. + /// The number of compute nodes currently + /// assigned to the compute. + /// Node size. + /// Node size family. + /// Azure subscription identifier. + /// Name of the resource group in which + /// workspace is located. + /// Name of Azure Machine Learning + /// workspace. + /// Pool name. + public SynapseSparkProperties(AutoScaleProperties autoScaleProperties = default(AutoScaleProperties), AutoPauseProperties autoPauseProperties = default(AutoPauseProperties), string sparkVersion = default(string), int? nodeCount = default(int?), string nodeSize = default(string), string nodeSizeFamily = default(string), string subscriptionId = default(string), string resourceGroup = default(string), string workspaceName = default(string), string poolName = default(string)) + { + AutoScaleProperties = autoScaleProperties; + AutoPauseProperties = autoPauseProperties; + SparkVersion = sparkVersion; + NodeCount = nodeCount; + NodeSize = nodeSize; + NodeSizeFamily = nodeSizeFamily; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + WorkspaceName = workspaceName; + PoolName = poolName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets auto scale properties. + /// + [JsonProperty(PropertyName = "autoScaleProperties")] + public AutoScaleProperties AutoScaleProperties { get; set; } + + /// + /// Gets or sets auto pause properties. + /// + [JsonProperty(PropertyName = "autoPauseProperties")] + public AutoPauseProperties AutoPauseProperties { get; set; } + + /// + /// Gets or sets spark version. + /// + [JsonProperty(PropertyName = "sparkVersion")] + public string SparkVersion { get; set; } + + /// + /// Gets or sets the number of compute nodes currently assigned to the + /// compute. + /// + [JsonProperty(PropertyName = "nodeCount")] + public int? NodeCount { get; set; } + + /// + /// Gets or sets node size. + /// + [JsonProperty(PropertyName = "nodeSize")] + public string NodeSize { get; set; } + + /// + /// Gets or sets node size family. + /// + [JsonProperty(PropertyName = "nodeSizeFamily")] + public string NodeSizeFamily { get; set; } + + /// + /// Gets or sets azure subscription identifier. + /// + [JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId { get; set; } + + /// + /// Gets or sets name of the resource group in which workspace is + /// located. + /// + [JsonProperty(PropertyName = "resourceGroup")] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets name of Azure Machine Learning workspace. + /// + [JsonProperty(PropertyName = "workspaceName")] + public string WorkspaceName { get; set; } + + /// + /// Gets or sets pool name. + /// + [JsonProperty(PropertyName = "poolName")] + public string PoolName { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SystemData.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SystemData.cs new file mode 100644 index 0000000000000..f53d17133688c --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource last + /// modification (UTC) + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} 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/TrackedResource.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/TrackedResource.cs new file mode 100644 index 0000000000000..5716d023a8d45 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/TrackedResource.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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Tracked Resource + /// + /// + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' + /// + public partial class TrackedResource : Resource + { + /// + /// Initializes a new instance of the TrackedResource class. + /// + public TrackedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TrackedResource class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + : base(id, name, type) + { + Tags = tags; + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/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..1ffcd96b5833b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Usage.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 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. + /// Region of the AML workspace in + /// the 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 amlWorkspaceLocation = default(string), string type = default(string), string unit = default(string), long? currentValue = default(long?), long? limit = default(long?), UsageName name = default(UsageName)) + { + Id = id; + AmlWorkspaceLocation = amlWorkspaceLocation; + 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 region of the AML workspace in the id. + /// + [JsonProperty(PropertyName = "amlWorkspaceLocation")] + public string AmlWorkspaceLocation { 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/UserAssignedIdentity.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UserAssignedIdentity.cs new file mode 100644 index 0000000000000..e2e6c9da48d5b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/UserAssignedIdentity.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// User Assigned Identity + /// + public partial class UserAssignedIdentity + { + /// + /// Initializes a new instance of the UserAssignedIdentity class. + /// + public UserAssignedIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserAssignedIdentity class. + /// + /// The principal ID of the user assigned + /// identity. + /// The tenant ID of the user assigned + /// identity. + /// The clientId(aka appId) of the user assigned + /// identity. + public UserAssignedIdentity(string principalId = default(string), string tenantId = default(string), string clientId = default(string)) + { + PrincipalId = principalId; + TenantId = tenantId; + ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal ID of the user assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the tenant ID of the user assigned identity. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets the clientId(aka appId) of the user assigned identity. + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; private set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VMPriceOSType.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VMPriceOSType.cs new file mode 100644 index 0000000000000..2748a8757a34d --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VMPriceOSType.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 VMPriceOSType. + /// + public static class VMPriceOSType + { + public const string Linux = "Linux"; + public const string Windows = "Windows"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VMTier.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VMTier.cs new file mode 100644 index 0000000000000..bc3fccff8ca45 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VMTier.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 VMTier. + /// + public static class VMTier + { + public const string Standard = "Standard"; + public const string LowPriority = "LowPriority"; + public const string Spot = "Spot"; + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ValueFormat.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ValueFormat.cs new file mode 100644 index 0000000000000..804ef84903cd4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/ValueFormat.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 ValueFormat. + /// + public static class ValueFormat + { + public const string JSON = "JSON"; + } +} 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..c7ca2851f9fe2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachine.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; + + /// + /// A Machine Learning compute based on Azure Virtual Machines. + /// + public partial class VirtualMachine : Compute + { + /// + /// Initializes a new instance of the VirtualMachine class. + /// + public VirtualMachine() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachine class. + /// + /// Location for the underlying + /// compute + /// The provision state of the cluster. + /// Valid values are Unknown, Updating, Provisioning, Succeeded, and + /// Failed. Possible values include: 'Unknown', 'Updating', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' + /// The description of the Machine Learning + /// compute. + /// The time at which the compute was + /// created. + /// The time at which 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. + /// Opt-out of local authentication and + /// ensure customers can use only MSI and AAD exclusively for + /// authentication. + 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?), bool? disableLocalAuth = default(bool?), VirtualMachineProperties properties = default(VirtualMachineProperties)) + : base(computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute, disableLocalAuth) + { + 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/VirtualMachineImage.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineImage.cs new file mode 100644 index 0000000000000..1ed343239c150 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineImage.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 Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Virtual Machine image for Windows AML Compute + /// + public partial class VirtualMachineImage + { + /// + /// Initializes a new instance of the VirtualMachineImage class. + /// + public VirtualMachineImage() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineImage class. + /// + /// Virtual Machine image path + public VirtualMachineImage(string id) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual Machine image path + /// + [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/VirtualMachineProperties.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineProperties.cs new file mode 100644 index 0000000000000..899da7c32088d --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineProperties.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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 + /// Indicates whether this + /// compute will be used for running notebooks. + public VirtualMachineProperties(string virtualMachineSize = default(string), int? sshPort = default(int?), string address = default(string), VirtualMachineSshCredentials administratorAccount = default(VirtualMachineSshCredentials), bool? isNotebookInstanceCompute = default(bool?)) + { + VirtualMachineSize = virtualMachineSize; + SshPort = sshPort; + Address = address; + AdministratorAccount = administratorAccount; + IsNotebookInstanceCompute = isNotebookInstanceCompute; + 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; } + + /// + /// Gets or sets indicates whether this compute will be used for + /// running notebooks. + /// + [JsonProperty(PropertyName = "isNotebookInstanceCompute")] + public bool? IsNotebookInstanceCompute { 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..eb0dccd9278ad --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/VirtualMachineSize.cs @@ -0,0 +1,180 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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 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 + /// Estimated VM prices + /// Supported Compute Types + 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?), EstimatedVMPrices estimatedVMPrices = default(EstimatedVMPrices), IList supportedComputeTypes = default(IList)) + { + Name = name; + Family = family; + VCPUs = vCPUs; + Gpus = gpus; + OsVhdSizeMB = osVhdSizeMB; + MaxResourceVolumeMB = maxResourceVolumeMB; + MemoryGB = memoryGB; + LowPriorityCapable = lowPriorityCapable; + PremiumIO = premiumIO; + EstimatedVMPrices = estimatedVMPrices; + SupportedComputeTypes = supportedComputeTypes; + 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; } + + /// + /// Gets or sets estimated VM prices + /// + /// + /// The estimated price information for using a VM. + /// + [JsonProperty(PropertyName = "estimatedVMPrices")] + public EstimatedVMPrices EstimatedVMPrices { get; set; } + + /// + /// Gets or sets supported Compute Types + /// + /// + /// Specifies the compute types supported by the virtual machine size. + /// + [JsonProperty(PropertyName = "supportedComputeTypes")] + public IList SupportedComputeTypes { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (EstimatedVMPrices != null) + { + EstimatedVMPrices.Validate(); + } + } + } +} 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..8361485684fdf --- /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 value = default(IList)) + { + Value = value; + 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 = "value")] + public IList Value { 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..10e880813a7f8 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/Workspace.cs @@ -0,0 +1,370 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The immutable id associated with this + /// workspace. + /// The description of this + /// workspace. + /// The friendly name for this workspace. + /// This name in mutable + /// 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. + /// Whether requests from Public + /// Network are allowed. Possible values include: 'Enabled', + /// 'Disabled' + /// The list of private + /// endpoint connections in the workspace. + /// The list of shared private + /// link resources in this workspace. + /// The notebook info of Azure ML + /// workspace. + /// The service managed + /// resource settings. + /// The user assigned + /// identity resource id that represents the workspace + /// identity. + /// The tenant id associated with this + /// workspace. + /// If the storage associated with the + /// workspace has hierarchical namespace(HNS) enabled. + /// The URI associated with this + /// workspace that machine learning flow must point at to set up + /// tracking. + /// The identity of the resource. + /// Specifies the location of the + /// resource. + /// Contains resource tags defined as key/value + /// pairs. + /// The sku of the workspace. + /// System data + public Workspace(string id = default(string), string name = default(string), string type = default(string), string workspaceId = default(string), string description = default(string), string friendlyName = default(string), 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?), string publicNetworkAccess = default(string), IList privateEndpointConnections = default(IList), IList sharedPrivateLinkResources = default(IList), NotebookResourceInfo notebookInfo = default(NotebookResourceInfo), ServiceManagedResourcesSettings serviceManagedResourcesSettings = default(ServiceManagedResourcesSettings), string primaryUserAssignedIdentity = default(string), string tenantId = default(string), bool? storageHnsEnabled = default(bool?), string mlFlowTrackingUri = default(string), Identity identity = default(Identity), string location = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), SystemData systemData = default(SystemData)) + : base(id, name, type) + { + WorkspaceId = workspaceId; + Description = description; + FriendlyName = friendlyName; + KeyVault = keyVault; + ApplicationInsights = applicationInsights; + ContainerRegistry = containerRegistry; + StorageAccount = storageAccount; + DiscoveryUrl = discoveryUrl; + ProvisioningState = provisioningState; + Encryption = encryption; + HbiWorkspace = hbiWorkspace; + ServiceProvisionedResourceGroup = serviceProvisionedResourceGroup; + PrivateLinkCount = privateLinkCount; + ImageBuildCompute = imageBuildCompute; + AllowPublicAccessWhenBehindVnet = allowPublicAccessWhenBehindVnet; + PublicNetworkAccess = publicNetworkAccess; + PrivateEndpointConnections = privateEndpointConnections; + SharedPrivateLinkResources = sharedPrivateLinkResources; + NotebookInfo = notebookInfo; + ServiceManagedResourcesSettings = serviceManagedResourcesSettings; + PrimaryUserAssignedIdentity = primaryUserAssignedIdentity; + TenantId = tenantId; + StorageHnsEnabled = storageHnsEnabled; + MlFlowTrackingUri = mlFlowTrackingUri; + Identity = identity; + Location = location; + Tags = tags; + Sku = sku; + SystemData = systemData; + 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 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 or sets whether requests from Public Network are allowed. + /// Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public string PublicNetworkAccess { get; set; } + + /// + /// Gets the list of private endpoint connections in the workspace. + /// + [JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public IList PrivateEndpointConnections { get; private set; } + + /// + /// Gets or sets the list of shared private link resources in this + /// workspace. + /// + [JsonProperty(PropertyName = "properties.sharedPrivateLinkResources")] + public IList SharedPrivateLinkResources { get; set; } + + /// + /// Gets the notebook info of Azure ML workspace. + /// + [JsonProperty(PropertyName = "properties.notebookInfo")] + public NotebookResourceInfo NotebookInfo { get; private set; } + + /// + /// Gets or sets the service managed resource settings. + /// + [JsonProperty(PropertyName = "properties.serviceManagedResourcesSettings")] + public ServiceManagedResourcesSettings ServiceManagedResourcesSettings { get; set; } + + /// + /// Gets or sets the user assigned identity resource id that represents + /// the workspace identity. + /// + [JsonProperty(PropertyName = "properties.primaryUserAssignedIdentity")] + public string PrimaryUserAssignedIdentity { get; set; } + + /// + /// Gets the tenant id associated with this workspace. + /// + [JsonProperty(PropertyName = "properties.tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets if the storage associated with the workspace has hierarchical + /// namespace(HNS) enabled. + /// + [JsonProperty(PropertyName = "properties.storageHnsEnabled")] + public bool? StorageHnsEnabled { get; private set; } + + /// + /// Gets the URI associated with this workspace that machine learning + /// flow must point at to set up tracking. + /// + [JsonProperty(PropertyName = "properties.mlFlowTrackingUri")] + public string MlFlowTrackingUri { 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 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; } + + /// + /// Gets or sets system data + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Encryption != null) + { + Encryption.Validate(); + } + if (PrivateEndpointConnections != null) + { + foreach (var element in PrivateEndpointConnections) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceConnection.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceConnection.cs new file mode 100644 index 0000000000000..afa5c234183f5 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceConnection.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.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Workspace connection. + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkspaceConnection : IResource + { + /// + /// Initializes a new instance of the WorkspaceConnection class. + /// + public WorkspaceConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceConnection class. + /// + /// ResourceId of the workspace connection. + /// Friendly name of the workspace + /// connection. + /// Resource type of workspace connection. + /// Category of the workspace + /// connection. + /// Target of the workspace connection. + /// Authorization type of the workspace + /// connection. + /// Value details of the workspace + /// connection. + /// format for the workspace connection + /// value. Possible values include: 'JSON' + public WorkspaceConnection(string id = default(string), string name = default(string), string type = default(string), string category = default(string), string target = default(string), string authType = default(string), string value = default(string), string valueFormat = default(string)) + { + Id = id; + Name = name; + Type = type; + Category = category; + Target = target; + AuthType = authType; + Value = value; + ValueFormat = valueFormat; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resourceId of the workspace connection. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets friendly name of the workspace connection. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type of workspace connection. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets category of the workspace connection. + /// + [JsonProperty(PropertyName = "properties.category")] + public string Category { get; set; } + + /// + /// Gets or sets target of the workspace connection. + /// + [JsonProperty(PropertyName = "properties.target")] + public string Target { get; set; } + + /// + /// Gets or sets authorization type of the workspace connection. + /// + [JsonProperty(PropertyName = "properties.authType")] + public string AuthType { get; set; } + + /// + /// Gets or sets value details of the workspace connection. + /// + [JsonProperty(PropertyName = "properties.value")] + public string Value { get; set; } + + /// + /// Gets or sets format for the workspace connection value. Possible + /// values include: 'JSON' + /// + [JsonProperty(PropertyName = "properties.valueFormat")] + public string ValueFormat { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceSku.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceSku.cs new file mode 100644 index 0000000000000..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..72ac34df497f4 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspaceUpdateParameters.cs @@ -0,0 +1,131 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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 identity of the resource. + /// The description of this + /// workspace. + /// The friendly name for this + /// workspace. + /// The compute name for image + /// build + /// The service managed + /// resource settings. + /// The user assigned + /// identity resource id that represents the workspace + /// identity. + /// Whether requests from Public + /// Network are allowed. Possible values include: 'Enabled', + /// 'Disabled' + public WorkspaceUpdateParameters(IDictionary tags = default(IDictionary), Sku sku = default(Sku), Identity identity = default(Identity), string description = default(string), string friendlyName = default(string), string imageBuildCompute = default(string), ServiceManagedResourcesSettings serviceManagedResourcesSettings = default(ServiceManagedResourcesSettings), string primaryUserAssignedIdentity = default(string), string publicNetworkAccess = default(string)) + { + Tags = tags; + Sku = sku; + Identity = identity; + Description = description; + FriendlyName = friendlyName; + ImageBuildCompute = imageBuildCompute; + ServiceManagedResourcesSettings = serviceManagedResourcesSettings; + PrimaryUserAssignedIdentity = primaryUserAssignedIdentity; + PublicNetworkAccess = publicNetworkAccess; + 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 identity of the resource. + /// + [JsonProperty(PropertyName = "identity")] + public Identity Identity { 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; } + + /// + /// Gets or sets the compute name for image build + /// + [JsonProperty(PropertyName = "properties.imageBuildCompute")] + public string ImageBuildCompute { get; set; } + + /// + /// Gets or sets the service managed resource settings. + /// + [JsonProperty(PropertyName = "properties.serviceManagedResourcesSettings")] + public ServiceManagedResourcesSettings ServiceManagedResourcesSettings { get; set; } + + /// + /// Gets or sets the user assigned identity resource id that represents + /// the workspace identity. + /// + [JsonProperty(PropertyName = "properties.primaryUserAssignedIdentity")] + public string PrimaryUserAssignedIdentity { get; set; } + + /// + /// Gets or sets whether requests from Public Network are allowed. + /// Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public string PublicNetworkAccess { get; set; } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspacesDiagnoseHeaders.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspacesDiagnoseHeaders.cs new file mode 100644 index 0000000000000..40dc803433699 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Models/WorkspacesDiagnoseHeaders.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.Linq; + + /// + /// Defines headers for Diagnose operation. + /// + public partial class WorkspacesDiagnoseHeaders + { + /// + /// Initializes a new instance of the WorkspacesDiagnoseHeaders class. + /// + public WorkspacesDiagnoseHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacesDiagnoseHeaders class. + /// + /// URI to poll for asynchronous operation + /// result. + /// Duration the client should wait between + /// requests, in seconds. + public WorkspacesDiagnoseHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URI to poll for asynchronous operation result. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets duration the client should wait between requests, in + /// seconds. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { 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..beab2ccd8d43d --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/Operations.cs @@ -0,0 +1,230 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/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..5eae16266a19f --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -0,0 +1,945 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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; } + + /// + /// List all the private endpoint connections associated with the workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + // 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}/privateEndpointConnections").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(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 (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + 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, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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..ab9dedd2008fc --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -0,0 +1,214 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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 PrivateEndpointConnectionsOperations. + /// + public static partial class PrivateEndpointConnectionsOperationsExtensions + { + /// + /// List all the private endpoint connections associated with the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static IEnumerable List(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// List all the private endpoint connections associated with the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the specified private endpoint connection associated with the + /// workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 CreateOrUpdate(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, PrivateEndpointConnection properties) + { + return operations.CreateOrUpdateAsync(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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 CreateOrUpdateAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, PrivateEndpointConnection properties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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..116e28bfee17b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/PrivateLinkResourcesOperations.cs @@ -0,0 +1,275 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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}/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..86ffef32df9d0 --- /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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static PrivateLinkResourceListResult List(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link resources that need to be created for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(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..bcbbae60af8f2 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/QuotasOperations.cs @@ -0,0 +1,642 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + // 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 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; + } + + /// + /// 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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + 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 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; + } + + /// + /// 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/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..a7de23a6a3392 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/SdkInfo_AzureMachineLearningWorkspaces.cs @@ -0,0 +1,37 @@ + +// +// Code generated by 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", "Compute", "2021-07-01"), + new Tuple("MachineLearningServices", "Operations", "2021-07-01"), + new Tuple("MachineLearningServices", "PrivateEndpointConnections", "2021-07-01"), + new Tuple("MachineLearningServices", "PrivateLinkResources", "2021-07-01"), + new Tuple("MachineLearningServices", "Quotas", "2021-07-01"), + new Tuple("MachineLearningServices", "Usages", "2021-07-01"), + new Tuple("MachineLearningServices", "VirtualMachineSizes", "2021-07-01"), + new Tuple("MachineLearningServices", "WorkspaceConnections", "2021-07-01"), + new Tuple("MachineLearningServices", "WorkspaceFeatures", "2021-07-01"), + new Tuple("MachineLearningServices", "WorkspaceSkus", "2021-07-01"), + new Tuple("MachineLearningServices", "Workspaces", "2021-07-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..b91f495acb5ec --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/UsagesOperations.cs @@ -0,0 +1,437 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + 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..f74ad1e0a34bc --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperationsExtensions.cs new file mode 100644 index 0000000000000..d6b5f57d895ea --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/VirtualMachineSizesOperationsExtensions.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for VirtualMachineSizesOperations. + /// + public static partial class VirtualMachineSizesOperationsExtensions + { + /// + /// Returns supported VM Sizes in a location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location upon which virtual-machine-sizes is queried. + /// + public static VirtualMachineSizeListResult List(this IVirtualMachineSizesOperations operations, string location) + { + return operations.ListAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Returns supported VM Sizes in a location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location upon which virtual-machine-sizes is queried. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IVirtualMachineSizesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceConnectionsOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceConnectionsOperations.cs new file mode 100644 index 0000000000000..ba1ca1cc7914d --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceConnectionsOperations.cs @@ -0,0 +1,954 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspaceConnectionsOperations operations. + /// + internal partial class WorkspaceConnectionsOperations : IServiceOperations, IWorkspaceConnectionsOperations + { + /// + /// Initializes a new instance of the WorkspaceConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspaceConnectionsOperations(AzureMachineLearningWorkspacesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMachineLearningWorkspacesClient + /// + public AzureMachineLearningWorkspacesClient Client { get; private set; } + + /// + /// List all connections under a AML workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Target of the workspace connection. + /// + /// + /// Category of the workspace connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string target = default(string), string category = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("target", target); + tracingParameters.Add("category", category); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (target != null) + { + _queryParameters.Add(string.Format("target={0}", System.Uri.EscapeDataString(target))); + } + if (category != null) + { + _queryParameters.Add(string.Format("category={0}", System.Uri.EscapeDataString(category))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + + /// + /// Add a new workspace connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The object for creating or updating a new workspace connection + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string connectionName, WorkspaceConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + + /// + /// Get the detail of a workspace connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + + /// + /// Delete a workspace connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new 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/WorkspaceConnectionsOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceConnectionsOperationsExtensions.cs new file mode 100644 index 0000000000000..3caa0c8e66f9d --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceConnectionsOperationsExtensions.cs @@ -0,0 +1,220 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MachineLearningServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspaceConnectionsOperations. + /// + public static partial class WorkspaceConnectionsOperationsExtensions + { + /// + /// List all connections under a AML workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Target of the workspace connection. + /// + /// + /// Category of the workspace connection. + /// + public static IEnumerable List(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string target = default(string), string category = default(string)) + { + return operations.ListAsync(resourceGroupName, workspaceName, target, category).GetAwaiter().GetResult(); + } + + /// + /// List all connections under a AML workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Target of the workspace connection. + /// + /// + /// Category of the workspace connection. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string target = default(string), string category = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, target, category, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Add a new workspace connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The object for creating or updating a new workspace connection + /// + public static WorkspaceConnection Create(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string connectionName, WorkspaceConnection parameters) + { + return operations.CreateAsync(resourceGroupName, workspaceName, connectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Add a new workspace connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The object for creating or updating a new workspace connection + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string connectionName, WorkspaceConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, workspaceName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the detail of a workspace connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + public static WorkspaceConnection Get(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string connectionName) + { + return operations.GetAsync(resourceGroupName, workspaceName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Get the detail of a workspace connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, connectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a workspace connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + public static void Delete(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string connectionName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete a workspace connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Friendly name of the workspace connection + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IWorkspaceConnectionsOperations operations, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperations.cs new file mode 100644 index 0000000000000..1f1d39c554c06 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceFeaturesOperations.cs @@ -0,0 +1,438 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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 + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/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..a545cbd4ee699 --- /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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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/WorkspaceSkusOperations.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceSkusOperations.cs new file mode 100644 index 0000000000000..a7330c74e8aed --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceSkusOperations.cs @@ -0,0 +1,409 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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; + + /// + /// WorkspaceSkusOperations operations. + /// + internal partial class WorkspaceSkusOperations : IServiceOperations, IWorkspaceSkusOperations + { + /// + /// Initializes a new instance of the WorkspaceSkusOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspaceSkusOperations(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 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces/skus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceSkusOperationsExtensions.cs b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceSkusOperationsExtensions.cs new file mode 100644 index 0000000000000..d22b468c4c78b --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspaceSkusOperationsExtensions.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 WorkspaceSkusOperations. + /// + public static partial class WorkspaceSkusOperationsExtensions + { + /// + /// Lists all skus with associated features + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IWorkspaceSkusOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all skus with associated features + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWorkspaceSkusOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(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 ListNext(this IWorkspaceSkusOperations operations, string nextPageLink) + { + return operations.ListNextAsync(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> ListNextAsync(this IWorkspaceSkusOperations 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..d784a0325a0ee --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperations.cs @@ -0,0 +1,3529 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 skip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("skip", skip); + 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 (skip != null) + { + _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(skip))); + } + 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; + } + + /// + /// Diagnose workspace setup issue. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameter of diagnosing workspace health + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DiagnoseWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DiagnoseWorkspaceParameters parameters = default(DiagnoseWorkspaceParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDiagnoseWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Resync all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ResyncKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginResyncKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// 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 skip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("skip", skip); + 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 (skip != null) + { + _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(skip))); + } + 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; + } + + /// + /// return notebook access token and refresh token + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> ListNotebookAccessTokenWithHttpMessagesAsync(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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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, "ListNotebookAccessToken", 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}/listNotebookAccessToken").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 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; + } + + /// + /// Prepare a notebook. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> PrepareNotebookWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginPrepareNotebookWithHttpMessagesAsync(resourceGroupName, workspaceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// List storage account keys of a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> ListStorageAccountKeysWithHttpMessagesAsync(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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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, "ListStorageAccountKeys", 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}/listStorageAccountKeys").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 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; + } + + /// + /// List keys of a notebook. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> ListNotebookKeysWithHttpMessagesAsync(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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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, "ListNotebookKeys", 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}/listNotebookKeys").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 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; + } + + /// + /// Called by Client (Portal, CLI, etc) to get a list of all external outbound + /// dependencies (FQDNs) programmatically. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> ListOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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, "ListOutboundNetworkDependenciesEndpoints", 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}/outboundNetworkDependenciesEndpoints").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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 != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new 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; + } + + /// + /// Diagnose workspace setup issue. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameter of diagnosing workspace health + /// + /// + /// 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> BeginDiagnoseWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DiagnoseWorkspaceParameters parameters = default(DiagnoseWorkspaceParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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, "BeginDiagnose", 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}/diagnose").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; + 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 != 202) + { + 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); + } + } + 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; + } + + /// + /// Resync all the keys associated with this workspace. This includes keys for + /// the storage account, app insights and password for container registry + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 BeginResyncKeysWithHttpMessagesAsync(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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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, "BeginResyncKeys", 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 && (int)_statusCode != 202) + { + 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; + } + + /// + /// Prepare a notebook. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> BeginPrepareNotebookWithHttpMessagesAsync(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.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (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, "BeginPrepareNotebook", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/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..d6a8dbe182a08 --- /dev/null +++ b/sdk/machinelearningservices/Microsoft.Azure.Management.MachineLearningServices/src/Generated/WorkspacesOperationsExtensions.cs @@ -0,0 +1,881 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Continuation token for pagination. + /// + public static IPage ListByResourceGroup(this IWorkspacesOperations operations, string resourceGroupName, string skip = default(string)) + { + return operations.ListByResourceGroupAsync(resourceGroupName, skip).GetAwaiter().GetResult(); + } + + /// + /// Lists all the available machine learning workspaces under the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Continuation token for pagination. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IWorkspacesOperations operations, string resourceGroupName, string skip = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, skip, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Diagnose workspace setup issue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameter of diagnosing workspace health + /// + public static DiagnoseResponseResult Diagnose(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, DiagnoseWorkspaceParameters parameters = default(DiagnoseWorkspaceParameters)) + { + return operations.DiagnoseAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Diagnose workspace setup issue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameter of diagnosing workspace health + /// + /// + /// The cancellation token. + /// + public static async Task DiagnoseAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, DiagnoseWorkspaceParameters parameters = default(DiagnoseWorkspaceParameters), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DiagnoseWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 skip = default(string)) + { + return operations.ListBySubscriptionAsync(skip).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 skip = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(skip, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// return notebook access token and refresh token + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static NotebookAccessTokenResult ListNotebookAccessToken(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListNotebookAccessTokenAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// return notebook access token and refresh token + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task ListNotebookAccessTokenAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNotebookAccessTokenWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Prepare a notebook. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static NotebookResourceInfo PrepareNotebook(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.PrepareNotebookAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Prepare a notebook. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task PrepareNotebookAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PrepareNotebookWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List storage account keys of a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static ListStorageAccountKeysResult ListStorageAccountKeys(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListStorageAccountKeysAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// List storage account keys of a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task ListStorageAccountKeysAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStorageAccountKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List keys of a notebook. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static ListNotebookKeysResult ListNotebookKeys(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListNotebookKeysAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// List keys of a notebook. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task ListNotebookKeysAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNotebookKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Called by Client (Portal, CLI, etc) to get a list of all external outbound + /// dependencies (FQDNs) programmatically. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static ExternalFQDNResponse ListOutboundNetworkDependenciesEndpoints(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Called by Client (Portal, CLI, etc) to get a list of all external outbound + /// dependencies (FQDNs) programmatically. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task ListOutboundNetworkDependenciesEndpointsAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a workspace with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static void BeginDelete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + operations.BeginDeleteAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Diagnose workspace setup issue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameter of diagnosing workspace health + /// + public static DiagnoseResponseResult BeginDiagnose(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, DiagnoseWorkspaceParameters parameters = default(DiagnoseWorkspaceParameters)) + { + return operations.BeginDiagnoseAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Diagnose workspace setup issue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The parameter of diagnosing workspace health + /// + /// + /// The cancellation token. + /// + public static async Task BeginDiagnoseAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, DiagnoseWorkspaceParameters parameters = default(DiagnoseWorkspaceParameters), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDiagnoseWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, 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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static void BeginResyncKeys(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + operations.BeginResyncKeysAsync(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. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task BeginResyncKeysAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginResyncKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Prepare a notebook. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + public static NotebookResourceInfo BeginPrepareNotebook(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.BeginPrepareNotebookAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Prepare a notebook. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of Azure Machine Learning workspace. + /// + /// + /// The cancellation token. + /// + public static async Task BeginPrepareNotebookAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginPrepareNotebookWithHttpMessagesAsync(resourceGroupName, workspaceName, 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; + } + } + + } +}